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

Merging of QBJoinTrees doesn't handle filter pushdowns correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.13.0
    • Query Processor
    • None

    Description

      The following query fails:
      (this based on the schema from auto_join_filters.q)

      explain
      SELECT sum(hash(a.key,a.value,b.key,b.value)) 
      FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.value = b.value  RIGHT OUTER JOIN myinput1 c 
           ON 
              b.value = c.value AND 
              a.key > 40
      

      Whereas this query succeeds

      explain
      SELECT sum(hash(a.key,a.value,b.key,b.value)) 
      FROM myinput1 a LEFT OUTER JOIN myinput1 b RIGHT OUTER JOIN myinput1 c 
           ON  a.value = b.value and
              b.value = c.value AND 
              a.key > 40
      

      Pushing the first condition to the first join, triggers a merge of the 2 QBJoinTrees. During merge all the right side filters identified for pushing are assumed to refer to the merging table (b in this case). But the pushable filters can refer to any left table.

      Attachments

        1. HIVE-5552.1.patch
          14 kB
          Harish Butani
        2. HIVE-5552.2.patch
          14 kB
          Harish Butani

        Issue Links

          Activity

            People

              rhbutani Harish Butani
              rhbutani Harish Butani
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: