From 61ce27439c12962627af1c528b745fe475f2a51e Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 10 Nov 2023 15:39:12 -0500 Subject: [PATCH] cargo fmt, update comments --- .../core/src/physical_optimizer/projection_pushdown.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/datafusion/core/src/physical_optimizer/projection_pushdown.rs b/datafusion/core/src/physical_optimizer/projection_pushdown.rs index da6d46b10c84..8e50492ae5e5 100644 --- a/datafusion/core/src/physical_optimizer/projection_pushdown.rs +++ b/datafusion/core/src/physical_optimizer/projection_pushdown.rs @@ -816,8 +816,9 @@ fn update_expr( // Update the index of `column`: Ok(Transformed::Yes(projected_exprs[column.index()].0.clone())) } else { - // Determine how to update `column` to accommodate `projected_exprs`: + // default to invalid, in case we can't find the relevant column state = RewriteState::RewrittenInvalid; + // Determine how to update `column` to accommodate `projected_exprs` projected_exprs .iter() .enumerate() @@ -831,12 +832,14 @@ fn update_expr( }, ) }) - .map_or_else(|_| Ok(Transformed::No(expr)), |c| Ok(Transformed::Yes(c))) + .map_or_else( + || Ok(Transformed::No(expr)), + |c| Ok(Transformed::Yes(c)), + ) } }); new_expr.map(|e| (state == RewriteState::RewrittenValid).then_some(e)) - }) } /// Creates a new [`ProjectionExec`] instance with the given child plan and