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

SortMergeJoin failed when using CROSS

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.1, 2.3.0
    • Component/s: SQL
    • Labels:
      None

      Description

      val df = Seq((1, 1)).toDF("i", "j")
      df.createOrReplaceTempView("T")
      withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") {
        sql("select * from (select a.i from T a cross join T t where t.i = a.i) as t1 " +
          "cross join T t2 where t2.i = t1.i").explain(true)
      }
      

      The above code could cause the following exception:

      SortMergeJoinExec should not take Cross as the JoinType
      java.lang.IllegalArgumentException: SortMergeJoinExec should not take Cross as the JoinType
      	at org.apache.spark.sql.execution.joins.SortMergeJoinExec.outputOrdering(SortMergeJoinExec.scala:100)
      

        Attachments

          Activity

            People

            • Assignee:
              smilegator Xiao Li
              Reporter:
              smilegator Xiao Li
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: