Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-34796

Codegen compilation error for query with LIMIT operator and without AQE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.1.0, 3.1.1, 3.2.0
    • 3.1.2, 3.2.0
    • SQL
    • None

    Description

      Example (reproduced in unit test):

       

        test("failed limit query") {
          withTable("left_table", "empty_right_table", "output_table") {
            spark.range(5).toDF("k").write.saveAsTable("left_table")
            spark.range(0).toDF("k").write.saveAsTable("empty_right_table")
               
            withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") {
              spark.sql("CREATE TABLE output_table (k INT) USING parquet")
              spark.sql(
                s"""
                   |INSERT INTO TABLE output_table
                   |SELECT t1.k FROM left_table t1
                   |JOIN empty_right_table t2
                   |ON t1.k = t2.k
                   |LIMIT 3
                   |""".stripMargin)
            }
          }
        }
      

      Result:

       

      https://gist.github.com/c21/ea760c75b546d903247582be656d9d66

      Attachments

        Activity

          People

            chengsu Cheng Su
            chengsu Cheng Su
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: