diff --git a/datafusion/expr/src/logical_plan/tree_node.rs b/datafusion/expr/src/logical_plan/tree_node.rs index 6850c30f4f81b..d606a445ed23e 100644 --- a/datafusion/expr/src/logical_plan/tree_node.rs +++ b/datafusion/expr/src/logical_plan/tree_node.rs @@ -385,8 +385,10 @@ fn rewrite_extension_inputs Result {{ $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) }}; } @@ -746,13 +748,12 @@ impl LogicalPlan { node: LogicalPlan, f: &mut F, ) -> Result> { - 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)