-
- Downloads
[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 <hvanhovell@databricks.com> Closes #16026 from hvanhovell/SPARK-18597. (cherry picked from commit 38e29824) Signed-off-by:Herman van Hovell <hvanhovell@databricks.com>
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala 3 additions, 3 deletions...a/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala 33 additions, 0 deletions...he/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala
- sql/core/src/test/resources/sql-tests/inputs/anti-join.sql 7 additions, 0 deletionssql/core/src/test/resources/sql-tests/inputs/anti-join.sql
- sql/core/src/test/resources/sql-tests/results/anti-join.sql.out 29 additions, 0 deletions...re/src/test/resources/sql-tests/results/anti-join.sql.out
Please register or sign in to comment