-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-44549][SQL] Support window functions in correlated scalar subqueries #42383
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add test cases for window functions with:
- in EXISTS
- non-equality correlation cond
- aggregate
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/DecorrelateInnerQuery.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/DecorrelateInnerQuery.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/DecorrelateInnerQuery.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/DecorrelateInnerQuery.scala
Outdated
Show resolved
Hide resolved
added more tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! CC @allisonwang-db @cloud-fan for review as well
sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-aggregate.sql
Show resolved
Hide resolved
thanks, merging to master! |
What changes were proposed in this pull request?
Support window functions in correlated scalar subqueries.
Support in IN/EXISTS subqueries will come after we migrate them into DecorrelateInnerQuery framework. In addition, correlation is not yet supported inside the window function itself.
Why are the changes needed?
Supports more subqueries.
Does this PR introduce any user-facing change?
Yes, users can run more subqueries now.
How was this patch tested?
Unit and query tests. The results of query tests were checked against Postgresql.