From dc60f789edf2bd07062f57fd6fe126b107a45898 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 8 Apr 2024 06:09:58 -0400 Subject: [PATCH] Minor: remove unused LogicalPlan::transform code, adjust visibility --- datafusion/expr/src/logical_plan/plan.rs | 76 +----------------------- 1 file changed, 2 insertions(+), 74 deletions(-) diff --git a/datafusion/expr/src/logical_plan/plan.rs b/datafusion/expr/src/logical_plan/plan.rs index 4f55bbfe3f4d..3321a5c80f8c 100644 --- a/datafusion/expr/src/logical_plan/plan.rs +++ b/datafusion/expr/src/logical_plan/plan.rs @@ -1328,23 +1328,6 @@ macro_rules! handle_transform_recursion { }}; } -macro_rules! handle_transform_recursion_down { - ($F_DOWN:expr, $F_CHILD:expr) => {{ - $F_DOWN? - .transform_children(|n| n.map_subqueries($F_CHILD))? - .transform_sibling(|n| n.map_children($F_CHILD)) - }}; -} - -macro_rules! handle_transform_recursion_up { - ($SELF:expr, $F_CHILD:expr, $F_UP:expr) => {{ - $SELF - .map_subqueries($F_CHILD)? - .transform_sibling(|n| n.map_children($F_CHILD))? - .transform_parent(|n| $F_UP(n)) - }}; -} - impl LogicalPlan { pub fn visit_with_subqueries>( &self, @@ -1379,62 +1362,7 @@ impl LogicalPlan { .visit_sibling(|| self.apply_children(|c| c.apply_with_subqueries(f))) } - pub fn transform_with_subqueries Result>>( - self, - f: &F, - ) -> Result> { - self.transform_up_with_subqueries(f) - } - - pub fn transform_down_with_subqueries Result>>( - self, - f: &F, - ) -> Result> { - handle_transform_recursion_down!(f(self), |c| c.transform_down_with_subqueries(f)) - } - - pub fn transform_down_mut_with_subqueries< - F: FnMut(Self) -> Result>, - >( - self, - f: &mut F, - ) -> Result> { - handle_transform_recursion_down!(f(self), |c| c - .transform_down_mut_with_subqueries(f)) - } - - pub fn transform_up_with_subqueries Result>>( - self, - f: &F, - ) -> Result> { - handle_transform_recursion_up!(self, |c| c.transform_up_with_subqueries(f), f) - } - - pub fn transform_up_mut_with_subqueries< - F: FnMut(Self) -> Result>, - >( - self, - f: &mut F, - ) -> Result> { - handle_transform_recursion_up!(self, |c| c.transform_up_mut_with_subqueries(f), f) - } - - pub fn transform_down_up_with_subqueries< - FD: FnMut(Self) -> Result>, - FU: FnMut(Self) -> Result>, - >( - self, - f_down: &mut FD, - f_up: &mut FU, - ) -> Result> { - handle_transform_recursion!( - f_down(self), - |c| c.transform_down_up_with_subqueries(f_down, f_up), - f_up - ) - } - - fn apply_subqueries Result>( + pub fn apply_subqueries Result>( &self, mut f: F, ) -> Result { @@ -1453,7 +1381,7 @@ impl LogicalPlan { }) } - fn map_subqueries Result>>( + pub fn map_subqueries Result>>( self, mut f: F, ) -> Result> {