Skip to content
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

Deprecate OptimizerRule::try_optimize #11022

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

lewiszlw
Copy link
Member

Which issue does this PR close?

Closes #.

Rationale for this change

As we have already migrated built-in optimizer rules to use rewrite api, I think it's time to deprecate try_optimize api.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added optimizer Optimizer rules core Core datafusion crate labels Jun 20, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THank you @lewiszlw ! I think we should consider deprecating optimize_children instead of modifying its signature.

datafusion-examples/examples/rewrite_expr.rs Outdated Show resolved Hide resolved
@@ -77,6 +77,10 @@ pub trait OptimizerRule {
/// Note this API will be deprecated in the future as it requires `clone`ing
/// the input plan, which can be expensive. OptimizerRules should implement
/// [`Self::rewrite`] instead.
#[deprecated(
since = "40.0.0",
note = "please implement supports_rewrite and rewrite instead"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

datafusion/optimizer/src/utils.rs Show resolved Hide resolved
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

I am also pretty happy with how the TreeNode API is to work with now so this hopefully won't be too large a migration for anyone

@alamb alamb merged commit 6dffc53 into apache:main Jun 21, 2024
23 checks passed
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jun 22, 2024
* Deprecate OptimizerRule::try_optimize

* optimize_children

* Apply review suggestions

* Fix clippy lint
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jun 22, 2024
* Deprecate OptimizerRule::try_optimize

* optimize_children

* Apply review suggestions

* Fix clippy lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core datafusion crate optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants