peter-toth commented on code in PR #13589:
URL: https://github.com/apache/datafusion/pull/13589#discussion_r1862019495


##########
datafusion/expr/src/logical_plan/tree_node.rs:
##########
@@ -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(|| {

Review Comment:
   Yeah, it might look a bit weird at first, but actually the subquery 
expression plans in a `LogicalPlan` node and the children of that node are kind 
of siblings (in terms of recursion) and all of them are kind of children of the 
node.
   
   So the `.visit_sibling()` continuation from `.apply_subqueries()` (subquery 
expression plans of a node) to `.apply_children()` (children of a node) makes 
sense and it needs to happen in a `.visit_children()` continuation.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to