-
Couldn't load subscription status.
- Fork 1.7k
Remove deprecated function OptimizerRule::try_optimize
#15051
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.
Just some stylistic comments. I don't know this bit of code well enough to comment on more 🙈
optimizeroptimizer: remove OptimizerRule::try_optimize
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.
Thank you @qazxcdswe123 and @ctsk for the review
I think @ctsk 's comments and suggestions are worth considering and ideally doing before we merge this PR but I don't think they are strictly necessary and we could do them as follow on PRs as well
| /// Try to rewrite `plan` to an optimized form, returning `Transformed::yes` | ||
| /// if the plan was rewritten and `Transformed::no` if it was not. | ||
| /// | ||
| /// Note: this function is only called if [`Self::supports_rewrite`] returns |
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.
I think after this PR supports_rewrite becomes a noop (doesn't do anything) so I recommend we also mark it as deprecated as well (deprecated as of 47.0.0)
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.
Done
I also marked deprecated supports_rewrite in this PR as it's only a one line change
datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs
Outdated
Show resolved
Hide resolved
optimizer: remove OptimizerRule::try_optimizeOptimizerRule::try_optimize
c50f52e to
9870236
Compare
And also removed out dated comment
b0c5f2a to
3f2428b
Compare
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.
Thank you @qazxcdswe123 and @comphead -- this is a very nice improcement
| None | ||
| } | ||
|
|
||
| /// Does this rule support rewriting owned plans (rather than by reference)? |
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.
💯
| fn f_down(&mut self, node: LogicalPlan) -> Result<Transformed<LogicalPlan>> { | ||
| if self.apply_order == ApplyOrder::TopDown { | ||
| optimize_plan_node(node, self.rule, self.config) | ||
| { |
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.
minor is that it is strange to have this second level of nesting braces -- we can remove it as a follow on PR I think
* chore: cleanup deprecated optimizer API since version <= 40 follow up of apache#15027 * chore: inlined `optimize_plan_node` And also removed out dated comment * chore: deprecate `supports_rewrite` function
Follow up for #15027
optimizeroptimize_plan_nodeI've also noticed that, all
supports_rewritereturn true and not used anywhere, should we also remove it?