-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Small planner refactoring #17851
Small planner refactoring #17851
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,6 @@ func runPhases(ctx *plancontext.PlanningContext, root Operator) Operator { | |
|
||
op = phase.act(ctx, op) | ||
op = runRewriters(ctx, op) | ||
op = compact(ctx, op) | ||
} | ||
|
||
return addGroupByOnRHSOfJoin(op) | ||
|
@@ -699,6 +698,18 @@ func tryPushFilter(ctx *plancontext.PlanningContext, in *Filter) (Operator, *App | |
} | ||
src.Outer, in.Source = in, src.Outer | ||
return src, Rewrote("push filter to outer query in subquery container") | ||
case *Filter: | ||
if len(in.Predicates) == 0 { | ||
return in.Source, Rewrote("filter with no predicates removed") | ||
} | ||
|
||
other, isFilter := in.Source.(*Filter) | ||
if !isFilter { | ||
return in, NoRewrite | ||
} | ||
in.Source = other.Source | ||
in.Predicates = append(in.Predicates, other.Predicates...) | ||
return in, Rewrote("two filters merged into one") | ||
Comment on lines
+701
to
+712
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no plan output change, seems we do not have a case for filter over filter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this code was in |
||
} | ||
|
||
return in, NoRewrite | ||
|
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.
In this file there is still usage of
output = compact(ctx, output)
at L47