-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix LogicalPlan::..._with_subqueries
methods
#13589
Changes from 1 commit
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 |
---|---|---|
|
@@ -385,8 +385,10 @@ fn rewrite_extension_inputs<F: FnMut(LogicalPlan) -> Result<Transformed<LogicalP | |
macro_rules! handle_transform_recursion { | ||
($F_DOWN:expr, $F_CHILD:expr, $F_UP:expr) => {{ | ||
$F_DOWN? | ||
.transform_children(|n| n.map_subqueries($F_CHILD))? | ||
.transform_sibling(|n| n.map_children($F_CHILD))? | ||
.transform_children(|n| { | ||
n.map_subqueries($F_CHILD)? | ||
.transform_sibling(|n| n.map_children($F_CHILD)) | ||
})? | ||
.transform_parent($F_UP) | ||
}}; | ||
} | ||
|
@@ -675,9 +677,11 @@ impl LogicalPlan { | |
visitor | ||
.f_down(self)? | ||
.visit_children(|| { | ||
self.apply_subqueries(|c| c.visit_with_subqueries(visitor)) | ||
self.apply_subqueries(|c| c.visit_with_subqueries(visitor))? | ||
.visit_sibling(|| { | ||
self.apply_children(|c| c.visit_with_subqueries(visitor)) | ||
}) | ||
})? | ||
.visit_sibling(|| self.apply_children(|c| c.visit_with_subqueries(visitor)))? | ||
.visit_parent(|| visitor.f_up(self)) | ||
} | ||
|
||
|
@@ -710,13 +714,12 @@ impl LogicalPlan { | |
node: &LogicalPlan, | ||
f: &mut F, | ||
) -> Result<TreeNodeRecursion> { | ||
f(node)? | ||
.visit_children(|| { | ||
node.apply_subqueries(|c| apply_with_subqueries_impl(c, f)) | ||
})? | ||
.visit_sibling(|| { | ||
node.apply_children(|c| apply_with_subqueries_impl(c, f)) | ||
}) | ||
f(node)?.visit_children(|| { | ||
node.apply_subqueries(|c| apply_with_subqueries_impl(c, f))? | ||
.visit_sibling(|| { | ||
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 don't fully understand this -- the 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. Yeah, it might look a bit weird at first, but actually the subquery expression plans in a So the |
||
node.apply_children(|c| apply_with_subqueries_impl(c, f)) | ||
}) | ||
}) | ||
} | ||
|
||
apply_with_subqueries_impl(self, &mut f) | ||
|
@@ -746,13 +749,12 @@ impl LogicalPlan { | |
node: LogicalPlan, | ||
f: &mut F, | ||
) -> Result<Transformed<LogicalPlan>> { | ||
f(node)? | ||
.transform_children(|n| { | ||
n.map_subqueries(|c| transform_down_with_subqueries_impl(c, f)) | ||
})? | ||
.transform_sibling(|n| { | ||
n.map_children(|c| transform_down_with_subqueries_impl(c, f)) | ||
}) | ||
f(node)?.transform_children(|n| { | ||
n.map_subqueries(|c| transform_down_with_subqueries_impl(c, f))? | ||
.transform_sibling(|n| { | ||
n.map_children(|c| transform_down_with_subqueries_impl(c, f)) | ||
}) | ||
}) | ||
} | ||
|
||
transform_down_with_subqueries_impl(self, &mut f) | ||
|
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.
💯 comments