-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-51584][SQL] Add rule that pushes Project through Offset and Suite that tests it #50326
[SPARK-51584][SQL] Add rule that pushes Project through Offset and Suite that tests it #50326
Conversation
...rc/test/scala/org/apache/spark/sql/catalyst/optimizer/PushProjectionThroughOffsetSuite.scala
Outdated
Show resolved
Hide resolved
|
||
val query1 = testRelation | ||
.offset(5) | ||
.select(Symbol("a"), Symbol("b"), 'c') |
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.
.select(Symbol("a"), Symbol("b"), 'c') | |
.select($"a", $"b", $"c") |
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.
ditto for other places.
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.
Changed.
let's create a JIRA ticket for it |
I requested a JIRA account, so I will create it when I get approved. |
Created here: https://issues.apache.org/jira/browse/SPARK-51584. |
thanks, merging to master! |
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.
late LGTM.
…ite that tests it ### What changes were proposed in this pull request? Add a new rule PushProjectionThroughOffset analogous to PushProjectionThroughLimit, that pushes projection nodes beneath Offset nodes. ### Why are the changes needed? Currently, if a Project node is above a Offset and Limit node, the Project will get pushed through the Limit node, but not the Offset node, and then the Offset and LocalLimit nodes won't get swapped, eliminating the optimization LocalLimit nets in this case. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Created PushProjectionThroughOffsetSuite to test this new rule. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#50326 from Pajaraja/pavle-martinovic_data/ProjectionPushDownThroughLimit. Authored-by: pavle-martinovic_data <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
Add a new rule PushProjectionThroughOffset analogous to PushProjectionThroughLimit, that pushes projection nodes beneath Offset nodes.
Why are the changes needed?
Currently, if a Project node is above a Offset and Limit node, the Project will get pushed through the Limit node, but not the Offset node, and then the Offset and LocalLimit nodes won't get swapped, eliminating the optimization LocalLimit nets in this case.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Created PushProjectionThroughOffsetSuite to test this new rule.
Was this patch authored or co-authored using generative AI tooling?
No.