pub(crate) fn rebase_expr(
expr: &Expr,
base_exprs: &[Expr],
plan: &LogicalPlan,
) -> Result<Expr>Expand description
Rebuilds an Expr as a projection on top of a collection of Expr’s.
For example, the expression a + b < 1 would require, as input, the 2
individual columns, a and b. But, if the base expressions already
contain the a + b result, then that may be used in lieu of the a and
b columns.
This is useful in the context of a query like:
SELECT a + b < 1 … GROUP BY a + b
where post-aggregation, a + b need not be a projection against the
individual columns a and b, but rather it is a projection against the
a + b found in the GROUP BY.