Class AggregateGroupingSetsToUnionRule

All Implemented Interfaces:
SubstitutionRule, TransformationRule

@Enclosing public class AggregateGroupingSetsToUnionRule extends RelRule<AggregateGroupingSetsToUnionRule.Config> implements SubstitutionRule
Rule that converts a Aggregate with GROUPING SETS into a UNION ALL of simpler aggregates.

Example transformation:


   SELECT a, b, c FROM t GROUP BY GROUPING SETS ((a,b), (a,c))
 

Transformed to:


   SELECT a, b, NULL AS c FROM t GROUP BY a, b
   UNION ALL
   SELECT a, NULL AS b, c FROM t GROUP BY a, c