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

Julian Hyde commented on HIVE-15996:
------------------------------------

[~jcamachorodriguez] [~cartershanklin], Yes, I meant to say {{GROUPING_ID}}. 
The authors of the SQL standard were smart to extend GROUPING rather than 
create another function name, as Oracle did. The namespace (GROUPING_ID, 
GROUPING, GROUP_ID not to mention GROUP BY and GROUPING SETS) is over-full and 
confusing.

> Implement multiargument GROUPING function
> -----------------------------------------
>
>                 Key: HIVE-15996
>                 URL: https://issues.apache.org/jira/browse/HIVE-15996
>             Project: Hive
>          Issue Type: New Feature
>    Affects Versions: 2.2.0
>            Reporter: Carter Shanklin
>            Assignee: Jesus Camacho Rodriguez
>         Attachments: HIVE-15996.patch
>
>
> Per the SQL standard section 6.9:
> GROUPING ( CR1, ..., CRN-1, CRN )
> is equivalent to:
> CAST ( ( 2 * GROUPING ( CR1, ..., CRN-1 ) + GROUPING ( CRN ) ) AS IDT )
> So for example:
> select c1, c2, c3, grouping(c1, c2, c3) from e011_02 group by rollup(c1, c2, 
> c3);
> Should be allowed and equivalent to:
> select c1, c2, c3, 4*grouping(c1) + 2*grouping(c2) + grouping(c3) from 
> e011_02 group by rollup(c1, c2, c3);



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to