-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[EPIC]: reimplement all rules which contains global-state #4267
Comments
let me explain why. Due to global-state exists, we can't just optimize a subtree, we must traverse the whole tree. In fact, I prefer to A example: Merge Limit match plan {
Limit => {
match childPlan => {
Limit => { merge(limit, childlimit) }
_ => { don't match pattern, return None or recurse....}
}
}
_ => { don't match pattern, return None or recurse....}
} we just match BUT, global-state force we must handle various situations, and we must traverse the tree all. What's more, |
👍 the idea of pattern matching on the way back up during rewrite rules makes lots of sense to me 👍 |
I think it depends on what the global-state is. If the global states are predicates or something related to Column/Exprs, then we should remove such kind of global states.. But for some optimization rules, it might be better to keep a global state so that it is easily to figure out a best plan. |
I think today in DataFusion's logical optimizer rules, most of the complexity comes from dealing with predicates. That's why I want to introduce the QueryConstraints into the logical plan structs. |
Agree it,
Agree, especially for rule about projection/filter/agg. |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Current some rule contains
global-state
Such as
limit_push_down
useancestor: &Ancestor
collect the limit-state of whole tree.filter_push_down
#4266projection_push_down
#4265eliminate_limit
#4264limit_push_down
#4263reduce_outer_join
#4270eliminate_cross_join
#4176Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: