Remove cross join if one side of input is single row constant#23081
Merged
feilong-liu merged 1 commit intoprestodb:masterfrom Jul 16, 2024
Merged
Remove cross join if one side of input is single row constant#23081feilong-liu merged 1 commit intoprestodb:masterfrom
feilong-liu merged 1 commit intoprestodb:masterfrom
Conversation
b80af5a to
05be389
Compare
0fcb97b to
8e24401
Compare
kaikalur
requested changes
Jun 26, 2024
Contributor
kaikalur
left a comment
There was a problem hiding this comment.
Please add a couple of tests with maps and arrays literals where we see the most impact
...in/java/com/facebook/presto/sql/planner/iterative/rule/RemoveCrossJoinWithConstantInput.java
Outdated
Show resolved
Hide resolved
kaikalur
reviewed
Jun 26, 2024
Contributor
kaikalur
left a comment
There was a problem hiding this comment.
Add tests with cross join a constant with filter after the join
...in/java/com/facebook/presto/sql/planner/iterative/rule/RemoveCrossJoinWithConstantInput.java
Show resolved
Hide resolved
8e24401 to
8d193e7
Compare
Contributor
Author
Added these tests |
8d193e7 to
519a6cf
Compare
kaikalur
previously approved these changes
Jul 9, 2024
...in/java/com/facebook/presto/sql/planner/iterative/rule/RemoveCrossJoinWithConstantInput.java
Outdated
Show resolved
Hide resolved
519a6cf to
4744923
Compare
ajaygeorge
previously approved these changes
Jul 15, 2024
Contributor
ajaygeorge
left a comment
There was a problem hiding this comment.
Looks good.
Added some nits. Feel free to skip if the suggestions doesn't make sense.
...in/java/com/facebook/presto/sql/planner/iterative/rule/RemoveCrossJoinWithConstantInput.java
Outdated
Show resolved
Hide resolved
...in/java/com/facebook/presto/sql/planner/iterative/rule/RemoveCrossJoinWithConstantInput.java
Show resolved
Hide resolved
4744923 to
d0e47dc
Compare
d0e47dc to
d6f7af2
Compare
d6f7af2 to
cf57bb0
Compare
34 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix #23074
When one side of cross join inputs is single row with constant values, we can remove this cross join and replace it with a project node. This will simplify the plan, and enable more following optimizations, such as filter pushdown etc.
Motivation and Context
We observed savings enabled by this optimization in our workload.
Impact
We observed savings enabled by this optimization in our workload.
Test Plan
Unit tests
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.