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

Incorrect results from GROUPING SETS

    Details

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

      Description

      Queries with GROUPING SETS do not seem to be returning grand totals. For example, using the schema of CALCITE-729,

      > select grouping(deptno), deptno, loc from scott_clone.dept group by grouping sets (deptno), (loc);
      +------------+--------+---------------+
      |   EXPR$0   | DEPTNO |      LOC      |
      +------------+--------+---------------+
      | 1          | 10     | NEW YORK      |
      | 1          | 30     | CHICAGO       |
      | 1          | 40     | BOSTON        |
      | 1          | 20     | DALLAS        |
      +------------+--------+---------------+
      4 rows selected (0.079 seconds)

      There should be a row which gives the grand total for all DEPTNO values, and a row which gives the grand total for all LOC values.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: