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

duan xiong commented on CALCITE-4664:
-------------------------------------

[~julianhyde] I do some test in hive and postgresql , In hive, this  Sql  above 
is valid(must don't have a comma before 'GROUPING SETS',If have, It will filed 
because ParseExceprion ). but in postgresql, There must be a comma before 
'GROUPING SETS'.

!捕获.PNG!

> 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