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

Incorrect results from GROUPING SETS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • 1.4.0-incubating
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: