-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Minor: improve documentation for CommonSubexprEliminate
#9700
Conversation
/// refer to that new column. | ||
/// | ||
/// ```text | ||
/// ProjectionExec(exprs=[extract (day from new_col), extract (year from new_col)]) <-- reuse here |
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 @alamb just a question, so to read from the plan that Common Sub-expression Elimination optimization was applied we need to refer to new_col
but how it differs from plan with projection alias but no optimization applied?
In short my question is it possible to read from the plan that optimization has been applied?
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.
It is possible. The optimized plan will have an obvious intermediate Projection
plan that does some computation and the result will be referred later by other following plans (this pattern might occur in other reasons though
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 @alamb, this document is very clear 💯
/// refer to that new column. | ||
/// | ||
/// ```text | ||
/// ProjectionExec(exprs=[extract (day from new_col), extract (year from new_col)]) <-- reuse here |
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.
It is possible. The optimized plan will have an obvious intermediate Projection
plan that does some computation and the result will be referred later by other following plans (this pattern might occur in other reasons though
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.
Which issue does this PR close?
Part of #7013
Rationale for this change
In the context of looking at #9678 with @wiedld it was a little unclear what the
CommonSubexprEliminate
pass was doing without code explorationWhat changes are included in this PR?
Add some more description of what
CommonSubexprEliminate
does along with an exampleAre these changes tested?
By docs CI
Are there any user-facing changes?
No, just docs