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

Codegen compilation error for query with LIMIT operator and without AQE

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1.0, 3.1.1, 3.2.0
    • Fix Version/s: 3.1.2, 3.2.0
    • Component/s: SQL
    • Labels:
      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

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment