-
- Downloads
[SPARK-21835][SQL] RewritePredicateSubquery should not produce unresolved query plans
## What changes were proposed in this pull request? Correlated predicate subqueries are rewritten into `Join` by the rule `RewritePredicateSubquery` during optimization. It is possibly that the two sides of the `Join` have conflicting attributes. The query plans produced by `RewritePredicateSubquery` become unresolved and break structural integrity. We should check if there are conflicting attributes in the `Join` and de-duplicate them by adding a `Project`. ## How was this patch tested? Added tests. Author: Liang-Chi Hsieh <viirya@gmail.com> Closes #19050 from viirya/SPARK-21835.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala 35 additions, 4 deletions...la/org/apache/spark/sql/catalyst/optimizer/subquery.scala
- sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala 63 additions, 0 deletions...e/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Loading
Please register or sign in to comment