pub fn substitute_outer_references(
expr: &Expression,
outer_row: &FxHashMap<CompactArc<str>, Value>,
) -> ExpressionExpand description
Substitute outer references in an expression with their actual values.
This is used for correlated subqueries to enable predicate pushdown.
When we have a WHERE clause like o.user_id = u.id where u.id is an outer
reference, this function replaces u.id with its actual value (e.g., 42),
allowing the expression o.user_id = 42 to be pushed down to storage
for index usage.
§Arguments
expr- The expression to transformouter_row- Map of outer column names to their values
§Returns
A new expression with outer references replaced by literal values. Uses copy-on-write semantics: only clones when substitution is actually needed.