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

feat: encapsulate physical optimizer rules into a struct #6645

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

waynexia
Copy link
Member

@waynexia waynexia commented Jun 12, 2023

Which issue does this PR close?

Closes #.

Rationale for this change

Make a new struct PhysicalOptimizer to hold all physical optimizer rules. Like Optimizer for logical rules and Analyzer for analyzer rules. I found it's not very convenient when I want to customize physical optimize rules.

What changes are included in this PR?

New struct PhysicalOptimizer and several related methods on it.

Are these changes tested?

yes

Are there any user-facing changes?

It's a public struct

@github-actions github-actions bot added the core Core DataFusion crate label Jun 12, 2023
Copy link
Member

@jackwener jackwener left a comment

Choose a reason for hiding this comment

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

A great job

datafusion/core/src/physical_optimizer/optimizer.rs Outdated Show resolved Hide resolved
datafusion/core/src/physical_optimizer/optimizer.rs Outdated Show resolved Hide resolved
@jackwener jackwener force-pushed the physical-optimizer branch from ef34dbb to fe32605 Compare June 12, 2023 16:04
@jackwener jackwener merged commit 2d8a42e into apache:main Jun 12, 2023
@waynexia waynexia deleted the physical-optimizer branch June 12, 2023 17:08
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.

This is a nice change -- thank you @waynexia

@waynexia
Copy link
Member Author

Thanks for reviewing it ❤️

I think they are redundant because in general we don't need remove a rule.

🥹 It would be useful when I want to adjust the order of rules (by removing it and inserting a new one). But it's ok since the inner vector is public anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants