[ 
https://issues.apache.org/jira/browse/CALCITE-4664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17371781#comment-17371781
 ] 

xiejiajun commented on CALCITE-4664:
------------------------------------

The SQL is HiveSQL, I translated HiveSQL into PrestoSQL by Calcite. It's just a 
reference for others to understand.

> When group by is same as sub-query, grouping sets are missing
> -------------------------------------------------------------
>
>                 Key: CALCITE-4664
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4664
>             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 is missing
>  



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

Reply via email to