[
https://issues.apache.org/jira/browse/CALCITE-4649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18047099#comment-18047099
]
Mihai Budiu commented on CALCITE-4649:
--------------------------------------
It does look like a duplicate.
> Add AggregateExpandGroupingSetsRule, a planner rule that removes GROUPING SETS
> ------------------------------------------------------------------------------
>
> Key: CALCITE-4649
> URL: https://issues.apache.org/jira/browse/CALCITE-4649
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Priority: Major
>
> Add {{class AggregateExpandGroupingSetsRule}}, a planner rule that removes
> {{GROUPING SETS}}.
> Some databases do not support {{GROUPING SETS}}. (For example, BigQuery
> supports {{GROUP BY ROLLUP}} but not general {{GROUPING SETS}}.) But
> {{GROUPING SETS}} is a useful construct, increasingly used in user SQL, and
> also generated by rules (e.g. {{AggregateExpandWithinDistinctRule}}).
> The proposed rule would match an {{Aggregate}} whose {{groupSets}} field has
> more than one element, and would convert it to an {{Aggregate}} over a
> {{Join}} whose right-hand side is a list of integers, the group ids active in
> the query. Calls to the {{GROUP_ID}} field would be replaced by references to
> the group id column.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)