You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2014/12/09 16:05:12 UTC

[jira] [Commented] (CALCITE-512) Add GROUP_ID and GROUPING_ID functions

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

Jesus Camacho Rodriguez commented on CALCITE-512:
-------------------------------------------------

[~julianhyde], I have implemented the GROUPING__ID function using Calcite for HIVE-8988 (patch ready but not applied till HIVE-8974 goes through). I can help with this if you give me some hints about the sources that need to be adapted.

> Add GROUP_ID and GROUPING_ID functions
> --------------------------------------
>
>                 Key: CALCITE-512
>                 URL: https://issues.apache.org/jira/browse/CALCITE-512
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> Implement GROUP_ID and GROUPING_ID(expr [, expr]...) functions, as they are defined in Oracle.
> We already have, as of CALCITE-370, the GROUPING(expr) function. Now define GROUPING_ID:
> GROUPING_ID(e2, e1, e0)
>  == GROUPING(e2) * 4 
>   + GROUPING(e1) * 2
>   + GROUPING(e0)
> and similarly for different numbers of arguments.
> GROUP_ID() is equivalent to GROUPING_ID(x, y, z), where x, y, z are the expressions being grouped.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)