GitHub user hvanhovell opened a pull request:

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

    [SPARK-18597][SQL] Do not push-down join conditions to the left side of a 
Left Anti join [BRANCH-2.0]

    ## What changes were proposed in this pull request?
    We currently push down join conditions of a Left Anti join to both sides of 
the join. This is similar to Inner, Left Semi and Existence (a specialized left 
semi) join. The problem is that this changes the semantics of the join; a left 
anti join filters out rows that matches the join condition.
    
    This PR fixes this by only pushing down conditions to the right hand side 
of the join. This is similar to the behavior of left outer join.
    
    This PR is a backport of https://github.com/apache/spark/pull/16026
    
    ## How was this patch tested?
    Added tests to `FilterPushdownSuite.scala` and created a SQLQueryTestSuite 
file for left anti joins with a regression test.

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

    $ git pull https://github.com/hvanhovell/spark SPARK-18597-branch-2.0

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

    https://github.com/apache/spark/pull/16039.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 #16039
    
----
commit f36c16d0676bf5b77215709c15b743a03c72eebc
Author: Herman van Hovell <hvanhov...@databricks.com>
Date:   2016-11-28T15:10:52Z

    [SPARK-18597][SQL] Do not push-down join conditions to the right side of a 
LEFT ANTI join
    
    ## What changes were proposed in this pull request?
    We currently push down join conditions of a Left Anti join to both sides of 
the join. This is similar to Inner, Left Semi and Existence (a specialized left 
semi) join. The problem is that this changes the semantics of the join; a left 
anti join filters out rows that matches the join condition.
    
    This PR fixes this by only pushing down conditions to the left hand side of 
the join. This is similar to the behavior of left outer join.
    
    ## How was this patch tested?
    Added tests to `FilterPushdownSuite.scala` and created a SQLQueryTestSuite 
file for left anti joins with a regression test.
    
    Author: Herman van Hovell <hvanhov...@databricks.com>
    
    Closes #16026 from hvanhovell/SPARK-18597.
    
    (cherry picked from commit 38e29824d9a50464daa397c28e89610ed0aed4b6)
    Signed-off-by: Herman van Hovell <hvanhov...@databricks.com>
    
    # Conflicts:
    #   
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to