-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix NamedStructField should be rewritten in OperatorToFunction
in subquery regression (change ApplyFunctionRewrites
to use TreeNode API
#10032
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
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.
@wiedld and I found this while upgrading IOx.
The code in this PR fixes the regression, but I think it could be substantially shorter (and do less copying) by using the TreeNode APIs.
I will work on that later today hopefully
NamedStructField should be rewritten in OperatorToFunction
in subqueryNamedStructField should be rewritten in OperatorToFunction
in subquery regression
I reworked this PR to use the TreeNode API in a546e69 and I am quite happy with how it looks now |
}; | ||
let name_preserver = NamePreserver::new(&plan); | ||
|
||
plan.map_expressions(|expr| { |
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.
using the new map_expressions API it is quite straightforward to rewrite these expressions (and it doesn't copy them!)
|
||
plan.with_new_exprs(new_expr, new_inputs) |
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 copies the plan + expressions
NamedStructField should be rewritten in OperatorToFunction
in subquery regressionNamedStructField should be rewritten in OperatorToFunction
in subquery regression (change ApplyFunctionRewrites
to use TreeNode API
Thanks for the review @crepererum and for the help tracking this down @wiedld |
Which issue does this PR close?
Closes #10029
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Yes with new tests
Are there any user-facing changes?
Fix regression