You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chunwei Lei (Jira)" <ji...@apache.org> on 2020/09/14 02:18:00 UTC

[jira] [Resolved] (CALCITE-4239) RelMdUniqueKeys returns wrong unique keys for Aggregate with grouping sets

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

Chunwei Lei resolved CALCITE-4239.
----------------------------------
    Fix Version/s: 1.26.0
       Resolution: Fixed

Fixed in https://github.com/apache/calcite/commit/1ae20f3e47d9ffab52e934c077d1b7629f798a2f.

> RelMdUniqueKeys returns wrong unique keys for Aggregate with grouping sets
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-4239
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4239
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Chunwei Lei
>            Assignee: Chunwei Lei
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.26.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> For Aggregate with grouping sets, group by keys might not form a unique key. For example: 
> {code:java}
> //PostgreSQL
> create table test2(key bigint, value bigint);
> insert into test2 values
>  (1, null),
>  (null, 1);
> select key, value, count(*) from test2
> group by GROUPING SETS (key,value) 
> ;
> postgres=# select key, value, count(*) from test2
> postgres-# group by GROUPING SETS (key,value)
> postgres-# ;
>  key | value | count
> -----+-------+-------
>      |       |     1
>    1 |       |     1
>      |       |     1
>      |     1 |     1
> (4 rows)
> {code}
>  



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