Expand description
ROLLUP / CUBE / GROUPING SETS expansion and canonical key extraction.
The public entry point is expand_group_by, which inspects the raw AST
GROUP BY clause and returns:
canonical_keys: the full deduplicated column list (indices 0..N).grouping_sets: one entry per set; each entry is the subset of canonical-key indices that are active (non-NULL) in that set.
GROUPING(col) at query time resolves col to its canonical-key index and
checks whether that bit is absent from the row’s active set.
Structs§
- Grouping
Sets Expansion - Result of expanding a GROUP BY clause that contains ROLLUP/CUBE/GROUPING SETS.
Functions§
- expand_
group_ by - Expand the GROUP BY clause if it contains ROLLUP/CUBE/GROUPING SETS.
- resolve_
grouping_ col - Resolve the canonical index for a
GROUPING(col)argument.