[ 
https://issues.apache.org/jira/browse/CALCITE-5089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde resolved CALCITE-5089.
----------------------------------
    Resolution: Fixed

Fixed in 
[7c1e2746|https://github.com/apache/calcite/commit/7c1e2746b94a50f0bb08571287acb5327fdc1b16].
 (I fixed a [couple of 
things|https://github.com/julianhyde/calcite/tree/5089-group-by-distinct].)

> Allow GROUP BY ALL or DISTINCT set quantifier on GROUPING SETS
> --------------------------------------------------------------
>
>                 Key: CALCITE-5089
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5089
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.30.0
>         Environment: jdk8
>            Reporter: yanjing.wang
>            Assignee: yanjing.wang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.31.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> GROUP BY DISTINCT will be used to remove duplicate GROUPING SETS, for example:
> {code:java}
> SELECT product_id, product_class_id, count(*) from product GROUP BY DISTINCT 
> CUBE (product_id, product_class_id), ROLLUP (product_id, 
> product_class_id){code}
> it's equivalent to 
> {code:java}
> SELECT product_id, product_class_id, count(*) from product GROUP BY GROUPING 
> SETS ((product_id, product_class_id), (product_id), (product_class_id), ()) 
> {code}
> GROUP BY ALL will remain the duplicate GROUPING SETS, it's equivalent to 
> GROUP BY, so most databases use ALL as the default set quantifier.
> As far as I know the PostgreSQL and Trino support this syntax.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to