Expand description
GROUP BY key conversion and output naming.
Two concerns live here: turning a parsed GROUP BY clause into grouping key expressions (including resolving a key written as a SELECT-list output alias), and deriving the output column name each key is emitted under.
Functionsยง
- convert_
group_ by - Convert GROUP BY clause to SqlExpr list.
- convert_
group_ by_ with_ projection - Convert a GROUP BY clause, resolving SELECT-list output aliases.
- expr_
column_ name - The bare column name referenced by an
ast::Expr, when it is a simple or compound identifier;Nonefor any other expression shape. - group_
by_ output_ aliases - Derive the SELECT-list output alias for each GROUP BY key by correlating
each key with the projection item that references the same column. Returns
a
Vecparallel togroup_by:Some(alias)when a projection item explicitly aliases that grouped column (SELECT k AS label ... GROUP BY k), otherwiseNone(the output column name falls back to the raw grouped column name). - key_
column_ name - The bare column name of a GROUP BY key, when the key is a column reference.