Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-15996

Implement multiargument GROUPING function

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 3.0.0
    • Component/s: None
    • Labels:
    • Target Version/s:

      Description

      Per the SQL standard section 6.9:
      GROUPING ( CR1, ..., CRN-1, CRN )
      is equivalent to:
      CAST ( ( 2 * GROUPING ( CR1, ..., CRN-1 ) + GROUPING ( CRN ) ) AS IDT )
      So for example:
      select c1, c2, c3, grouping(c1, c2, c3) from e011_02 group by rollup(c1, c2, c3);
      Should be allowed and equivalent to:
      select c1, c2, c3, 4*grouping(c1) + 2*grouping(c2) + grouping(c3) from e011_02 group by rollup(c1, c2, c3);

        Attachments

        1. HIVE-15996.01.patch
          32 kB
          Jesus Camacho Rodriguez
        2. HIVE-15996.02.patch
          32 kB
          Jesus Camacho Rodriguez
        3. HIVE-15996.03.patch
          56 kB
          Jesus Camacho Rodriguez
        4. HIVE-15996.04.patch
          63 kB
          Jesus Camacho Rodriguez

          Issue Links

            Activity

              People

              • Assignee:
                jcamachorodriguez Jesus Camacho Rodriguez
                Reporter:
                cartershanklin Carter Shanklin
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: