GitHub user wangyum opened a pull request:

    https://github.com/apache/spark/pull/19714

    [SPARK-22489][SQL] Shouldn't change broadcast join buildSide if user 
clearly specified

    ## What changes were proposed in this pull request?
    
    How to reproduce:
    ```scala
    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`. This PR fix this 
issue.
    ## How was this patch tested?
    
    unit tests

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/wangyum/spark SPARK-22489

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/19714.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #19714
    
----
commit 68dfc42d80548c1eeb75275df43d4542146a60d4
Author: Yuming Wang <[email protected]>
Date:   2017-11-10T05:55:51Z

    Shouldn't change broadcast join buildSide if user clearly specified

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to