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

Shouldn't change broadcast join buildSide if user clearly specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.3.0
    • SQL
    • None

    Description

      How to reproduce:

      import org.apache.spark.sql.execution.joins.BroadcastHashJoinExec
      
      spark.createDataFrame(Seq((1, "4"), (2, "2"))).toDF("key", "value").createTempView("table1")
      spark.createDataFrame(Seq((1, "1"), (2, "2"))).toDF("key", "value").createTempView("table2")
      
      val bl = sql(s"SELECT /*+ MAPJOIN(t1) */ * FROM table1 t1 JOIN table2 t2 ON t1.key = t2.key").queryExecution.executedPlan
      
      println(bl.children.head.asInstanceOf[BroadcastHashJoinExec].buildSide)
      

      The result is BuildRight, but should be BuildLeft.

      Attachments

        Activity

          People

            yumwang Yuming Wang
            yumwang Yuming Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: