Skip to main content

partial_aliases

Function partial_aliases 

Source
fn partial_aliases(
    agg: &Aggregate,
    join: &Join,
    config: &dyn OptimizerConfig,
) -> (String, String, String, String)
Expand description

The four partial-aggregate output names, made collision-free against every field name the rewritten aggregates can still see.

OptimizerConfig::alias_generator only keeps generated aliases apart from each other, not from the input fields. A column literally named like a generated alias (say partial_nv_1) would then land next to the qualified grouping key of the same name in a partial aggregate’s output schema, and DFSchema rejects that plan as ambiguous: Schema contains qualified field name m.partial_nv_1 and unqualified field name partial_nv_1 which would be ambiguous. Prepending underscores until the name is unused keeps the names deterministic and mutually distinct; the visible column set is finite, so the loop terminates.