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

xiejiajun updated CALCITE-4665:
-------------------------------
    Description: 
For example:
{code:java}
SELECT
t.ID, t.NAME, count(t.AGE) T_AGE
FROM
(SELECT u.ID, u.NAME, u.AGE
FROM USERS u
GROUP BY u.ID, u.NAME, u.AGE
) t
GROUP BY t.ID, t.NAME, t.AGE
GROUPING SETS(
(t.ID, t.NAME),
(t.ID, t.NAME, t.AGE)
)
{code}
will be
{code}
SELECT u.ID, u.NAME, u.AGE
FROM USERS u
GROUP BY u.ID, u.NAME, u.AGE
{code}
groupings set are missing
 

  was:
For example:
{code:java}
SELECT
t.ID, t.NAME, count(t.AGE) T_AGE
FROM
(SELECT u.ID, u.NAME, u.AGE
FROM USERS u
GROUP BY u.ID, u.NAME, u.AGE
) t
GROUP BY t.ID, t.NAME, t.AGE
GROUPING SETS(
(t.ID, t.NAME),
(t.ID, t.NAME, t.AGE)
)
{code}
will be
{code}
SELECT u.ID, u.NAME, u.AGE
FROM USERS u
GROUP BY u.ID, u.NAME, u.AGE
{code}
groupings set is missing
 


> When group by is same as sub-query, grouping sets are missing
> -------------------------------------------------------------
>
>                 Key: CALCITE-4665
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4665
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: xiejiajun
>            Priority: Major
>
> For example:
> {code:java}
> SELECT
> t.ID, t.NAME, count(t.AGE) T_AGE
> FROM
> (SELECT u.ID, u.NAME, u.AGE
> FROM USERS u
> GROUP BY u.ID, u.NAME, u.AGE
> ) t
> GROUP BY t.ID, t.NAME, t.AGE
> GROUPING SETS(
> (t.ID, t.NAME),
> (t.ID, t.NAME, t.AGE)
> )
> {code}
> will be
> {code}
> SELECT u.ID, u.NAME, u.AGE
> FROM USERS u
> GROUP BY u.ID, u.NAME, u.AGE
> {code}
> groupings set are missing
>  



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

Reply via email to