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

Support GROUPING SETS in SQL and algebra

    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

      Support grouping sets in the relational algebra. This feature would add a new field, groupKeys, to aggregate rel that has a set of bit maps, each of which has a grouping key.

      For example, if 'group by x, y, z' is represented by

      AggregateRel(groupSet={0, 1, 2})
      

      then 'group by grouping sets (x, y, z), (y, z), ()' would be represented by

      AggregateRel(groupSet={0, 1, 2}, groupSets=[ {0, 1, 2}, {1, 2}, {} ])
      

      A regular group by, or a group by with a singleton grouping set, would have groupSets = null.

      If groupSets is present, the returned row type would include an indicator column for each grouping key.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: