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

Recognize COALESCE as CASE

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 4.0.0-alpha-1
    • CBO
    • None

    Description

      Transform:

      (COALESCE(a, '')  = '') OR
                 (a = 'A' AND b = c)  OR
                 (a = 'B' AND b = d) OR
                 (a = 'C' AND b = e) OR
                 (a = 'D' AND b = f) OR
                 (a = 'E' AND b = g) OR
                 (a = 'F' AND b = h)
      

      into:

      (a='') OR
                 (a is null) OR
                 (a = 'A' AND b = c)  OR
                 (a = 'B' AND b = d) OR
                 (a = 'C' AND b = e) OR
                 (a = 'D' AND b = f) OR
                 (a = 'E' AND b = g) OR
                 (a = 'F' AND b = h)
      

      With complex queries, this will lead us to factor more predicates that could be pushed to the TS.

      Attachments

        1. HIVE-14431.01.patch
          9 kB
          jcamachorodriguez
        2. HIVE-14431.03.patch
          3 kB
          Remus Rusanu
        3. HIVE-14431.04.patch
          14 kB
          jcamachorodriguez
        4. HIVE-14431.05.patch
          89 kB
          jcamachorodriguez
        5. HIVE-14431.05.patch
          89 kB
          jcamachorodriguez
        6. HIVE-14431.06.patch
          85 kB
          Zoltan Haindrich
        7. HIVE-14431.06.patch
          85 kB
          jcamachorodriguez
        8. HIVE-14431.06.patch
          85 kB
          Zoltan Haindrich
        9. HIVE-14431.2.patch
          9 kB
          Ashutosh Chauhan
        10. HIVE-14431.patch
          9 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: