-
Notifications
You must be signed in to change notification settings - Fork 1.9k
remove recursion in optimizer rules #4650
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
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 |
|---|---|---|
|
|
@@ -1329,12 +1329,16 @@ impl SubqueryAlias { | |
| /// If the value of `<predicate>` is true, the input row is passed to | ||
| /// the output. If the value of `<predicate>` is false, the row is | ||
| /// discarded. | ||
| /// | ||
| /// Filter should not be created directly but instead use `try_new()` | ||
| /// and that these fields are only pub to support pattern matching | ||
| #[derive(Clone)] | ||
| #[non_exhaustive] | ||
| pub struct Filter { | ||
| /// The predicate expression, which must have Boolean type. | ||
| predicate: Expr, | ||
| pub predicate: Expr, | ||
| /// The incoming logical plan | ||
| input: Arc<LogicalPlan>, | ||
| pub input: Arc<LogicalPlan>, | ||
|
Comment on lines
+1339
to
+1341
Member
Author
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. pub them because I need pattern-match in rules. Discussion about it in #4464. cc @alamb @andygrove @tustvold .
Contributor
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. I think it is ok -- it would be nice to add some comments explaining a |
||
| } | ||
|
|
||
| impl Filter { | ||
|
|
||
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.
these changes imply the decorrelate passes used to be applied bottom up and after this PR they are applied top-down
Is that intentional? Or maybe I am misreading the diff 🤔
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.
😂 original implementation mix
TopDownandBottomUp.It use
TopDownoverall, but useBottomUpwhen match the subPlan.I think it's a small mistake in original code but don't affect correctness.