-
Notifications
You must be signed in to change notification settings - Fork 1.8k
add propagate_empty_relation optimizer rule
#4192
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
Conversation
propagate_empty_relation optimizer rule
2b9192c to
cdcf6f3
Compare
|
Thanks @mingmwang. |
|
Thank you so much @jackwener. Overall, the PR LGTM. |
alamb
left a comment
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.
The only thing I would recommend it at least one test in https://github.com/apache/arrow-datafusion/blob/master/datafusion/optimizer/tests/integration-test.rs that shows this optimization working with other optimization passes
|
Thank you @jackwener |
|
Thanks @mingmwang @alamb @Dandandan review❤️ |
alamb
left a comment
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.
This looks really nice @jackwener -- thank you so much.
I'll wait a day to see if @mingmwang or @Dandandan want to review again as well and then I'll plan to merge it in.
| fn propagate_empty_relation() { | ||
| let sql = "SELECT col_int32 FROM test JOIN ( SELECT col_int32 FROM test WHERE false ) AS ta1 ON test.col_int32 = ta1.col_int32;"; | ||
| let plan = test_sql(sql).unwrap(); | ||
| // when children exist EmptyRelation, it will bottom-up propagate. |
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.
👍
|
Thanks again @jackwener |
|
Benchmark runs are scheduled for baseline = f0359a7 and contender = 5de9709. 5de9709 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3864.
We can propagate
empty_relationto eliminate useless plan.This is a bottom-up rule.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?