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

Implement multiargument GROUPING function

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 3.0.0
    • None

    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
          jcamachorodriguez
        2. HIVE-15996.02.patch
          32 kB
          jcamachorodriguez
        3. HIVE-15996.03.patch
          56 kB
          jcamachorodriguez
        4. HIVE-15996.04.patch
          63 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              cartershanklin Carter Shanklin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: