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

Lefty Leverenz commented on HIVE-15996:
---------------------------------------

This needs to be documented in the wiki, with version information.

* [Enhanced Aggregation, Cube, Grouping and Rollup | 
https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C+Grouping+and+Rollup]

The whole doc probably needs to be reviewed and updated.

> 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
>              Labels: TODOC3.0
>             Fix For: 3.0.0
>
>         Attachments: HIVE-15996.01.patch, HIVE-15996.02.patch, 
> HIVE-15996.03.patch, HIVE-15996.04.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