Function datafusion_expr::utils::enumerate_grouping_sets
source · pub fn enumerate_grouping_sets(group_expr: Vec<Expr>) -> Result<Vec<Expr>>
Expand description
Convert multiple grouping expressions into one GroupingSet::GroupingSets
,
if the grouping expression does not contain Expr::GroupingSet
or only has one expression,
no conversion will be performed.
e.g.
person.id,
GROUPING SETS ((person.age, person.salary),(person.age)),
ROLLUP(person.state, person.birth_date)
=>
GROUPING SETS (
(person.id, person.age, person.salary),
(person.id, person.age, person.salary, person.state),
(person.id, person.age, person.salary, person.state, person.birth_date),
(person.id, person.age),
(person.id, person.age, person.state),
(person.id, person.age, person.state, person.birth_date)
)