Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-512

Add GROUP_ID and GROUPING_ID functions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: