diff --git a/datafusion/core/src/physical_optimizer/enforce_distribution.rs b/datafusion/core/src/physical_optimizer/enforce_distribution.rs index c5609ae22fc0..c44200a492eb 100644 --- a/datafusion/core/src/physical_optimizer/enforce_distribution.rs +++ b/datafusion/core/src/physical_optimizer/enforce_distribution.rs @@ -1208,7 +1208,7 @@ fn ensure_distribution( // We store the updated children in `new_children`. let children = izip!( children.into_iter(), - plan.required_input_ordering().into_iter(), + plan.required_input_ordering(), plan.maintains_input_order(), repartition_status_flags.into_iter() ) diff --git a/datafusion/core/src/physical_optimizer/sanity_checker.rs b/datafusion/core/src/physical_optimizer/sanity_checker.rs index 0bb650b3f80b..f4b0f7c6069b 100644 --- a/datafusion/core/src/physical_optimizer/sanity_checker.rs +++ b/datafusion/core/src/physical_optimizer/sanity_checker.rs @@ -132,8 +132,8 @@ pub fn check_plan_sanity( for ((idx, child), sort_req, dist_req) in izip!( plan.children().into_iter().enumerate(), - plan.required_input_ordering().into_iter(), - plan.required_input_distribution().into_iter() + plan.required_input_ordering(), + plan.required_input_distribution(), ) { let child_eq_props = child.equivalence_properties(); if let Some(sort_req) = sort_req {