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

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

Fixed in 
[c7d18187|https://github.com/apache/calcite/commit/c7d1818763b7433f4ee2f47cc1536180ed5124fb];
 thanks for the PR, [~nobigo]!

(Thanks for reverting your change. It would be more efficient if a single 
{{Aggregate}} could handle non-distinct grouping sets, but a {{Union}} is less 
disruptive and allows us to reuse existing code. We can revisit in the future. 
But I think the case where there are duplicate grouping sets but no 
{{GROUP_ID}} function is fairly rare.)

> If there are duplicate GROUPING SETS, Calcite should return duplicate rows
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-4748
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4748
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.27.0
>            Reporter: duan xiong
>            Assignee: duan xiong
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.28.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When run SQL1:
> {code:java}
> select prod_id from foodmart.sales_fact_1997 as s group by grouping 
> sets(prod_id,prod_id){code}
> and SQL2:
> {code:java}
> select prod_id from foodmart.sales_fact_1997 as s group by grouping 
> sets(prod_id){code}
> get the SAME result. This is wrong. SQL1 return result's number = SQL2 return 
> result*2 number



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to