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

Extend limit propagation for chain of RS-GB-RS operators

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.2.0
    • Physical Optimizer
    • None

    Description

      The goal is to extend the work started in HIVE-14002.

      For instance, given the following query:

      explain
      select key, value, count(key + 1) as agg1 from src 
      group by key, value
      order by key, value, agg1 limit 20;
      

      We generate the following physical plan:
      TS1 - GBY2 - RS3 - GBY4 - RS5 - SEL6 - LIM7 - FS8

      We can push the limit to RS3 operator, as we will generate records for the top N keys, and thus, GBY4 will produce the top N results. However, currently we do not do it.

      Attachments

        1. HIVE-15474.03.patch
          63 kB
          jcamachorodriguez
        2. HIVE-15474.01.patch
          60 kB
          jcamachorodriguez
        3. HIVE-15474.patch
          14 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:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: