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

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

{code:java}
Hive:

select count(human_name),prtday from tmp_hivetb_0_2  group by prtday, grouping 
sets(prtday);

Error: Error while compiling statement: FAILED: ParseException line 1:70 cannot 
recognize input near 'grouping' 'sets' '(' in expression specification 
(state=42000,code=40000)
{code}

> 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