Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-13554 [Umbrella] SQL:2011 compliance
  3. HIVE-17617

Rollup of an empty resultset should contain the grouping of the empty grouping set

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • SQL
    • None

    Description

      running

      drop table if exists tx1;
      create table tx1 (a integer,b integer,c integer);
      
      select  sum(c),
              grouping(b)
      from    tx1
      group by rollup (b);
      

      returns 0 rows; however

      according to the standard:
      The <empty grouping set> is regarded as the shortest such initial sublist. For example, “ROLLUP ( (A, B), (C, D) )”
      is equivalent to “GROUPING SETS ( (A, B, C, D), (A, B), () )”.

      so I think the totals row (the grouping for () should be present) - psql returns it.

      Attachments

        1. HIVE-17617.01.patch
          25 kB
          Zoltan Haindrich
        2. HIVE-17617.03.patch
          19 kB
          Zoltan Haindrich
        3. HIVE-17617.04.patch
          12 kB
          Zoltan Haindrich
        4. HIVE-17617.05.patch
          15 kB
          Zoltan Haindrich
        5. HIVE-17617.06.patch
          23 kB
          Zoltan Haindrich
        6. HIVE-17617.07.patch
          28 kB
          Zoltan Haindrich
        7. HIVE-17617.07.patch
          28 kB
          Zoltan Haindrich
        8. HIVE-17617.08.patch
          28 kB
          Zoltan Haindrich

        Issue Links

          Activity

            People

              kgyrtkirk Zoltan Haindrich
              kgyrtkirk Zoltan Haindrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: