Skip to content

Commit

Permalink
cargo fmt, update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Nov 10, 2023
1 parent f81126d commit 61ce274
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions datafusion/core/src/physical_optimizer/projection_pushdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 61ce274

Please sign in to comment.