Expand description
Function-call name-substitution walker.
Used by the planner to apply ReplacementScanProvider-driven function
rewrites (M5 follow-up #5) as an AST pass before logical planning. The
walker descends into all expression-bearing positions and calls a
caller-supplied closure for each Expr::FunctionCall name. If the
closure returns Some(new_name), the call’s name is substituted in
place; arguments are recursively walked either way. Errors short-circuit
the entire traversal.
Mirrors the traversal shape of
crate::rewrite::walker::ExpressionWalker — the two could
eventually share a visitor trait, but for now the duplication is
deliberate: this walker takes &mut FnMut (so it can capture the
planner’s &self plus mutable state for hop-cap enforcement) and
propagates Result (so a wrong-variant or already-rerouted error
aborts cleanly), neither of which the rule-driven walker supports.
Functions§
- rewrite_
function_ calls_ in_ query - Walk
query, callingrenameon everyExpr::FunctionCallname (post-order: arguments are visited first). WhenrenamereturnsSome(new_name), the call’snameis replaced. When it returnsNone, the original name is kept. Errors propagate.