Description
Per the SQL standard section 6.9:
GROUPING ( CR1, ..., CRN-1, CRN )
is equivalent to:
CAST ( ( 2 * GROUPING ( CR1, ..., CRN-1 ) + GROUPING ( CRN ) ) AS IDT )
So for example:
select c1, c2, c3, grouping(c1, c2, c3) from e011_02 group by rollup(c1, c2, c3);
Should be allowed and equivalent to:
select c1, c2, c3, 4*grouping(c1) + 2*grouping(c2) + grouping(c3) from e011_02 group by rollup(c1, c2, c3);
Attachments
Attachments
Issue Links
- is blocked by
-
HIVE-15994 Grouping function error when grouping sets are not specified
- Closed
- relates to
-
CALCITE-1652 Allow GROUPING to have multiple arguments, like GROUPING_ID
- Closed
- links to