Hive
  1. Hive
  2. HIVE-3411

Filter predicates on outer join overlapped on single alias is not handled properly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.10.0
    • Component/s: Query Processor
    • Labels:
      None
    • Environment:

      ubuntu 10.10

    • Hadoop Flags:
      Reviewed

      Description

      Currently, join predicates on outer join are evaluated in join operator (or HashSink for MapJoin) and the result value is tagged to end of each values(as a boolean), which is used for joining values. But when predicates are overlapped on single alias, all the predicates are evaluated with AND conjunction, which makes invalid result.

      For example with table a with values,

      100 40
      100 50
      100 60
      

      Query below has overlapped predicates on alias b, which is making all the values on b are tagged with true(filtered)

      select * from a right outer join a b on (a.key=b.key AND a.value=50 AND b.value=50) left outer join a c on (b.key=c.key AND b.value=60 AND c.value=60);
      
      NULL	NULL	100	40	NULL	NULL
      NULL	NULL	100	50	NULL	NULL
      NULL	NULL	100	60	NULL	NULL
      
      -- Join predicate
      Join Operator
        condition map:
             Right Outer Join0 to 1
             Left Outer Join1 to 2
        condition expressions:
          0 {VALUE._col0} {VALUE._col1}
          1 {VALUE._col0} {VALUE._col1}
          2 {VALUE._col0} {VALUE._col1}
        filter predicates:
          0 
          1 {(VALUE._col1 = 50)} {(VALUE._col1 = 60)}
          2 
      

      but this should be

      NULL	NULL	100	40	NULL	NULL
      100	50	100	50	NULL	NULL
      NULL	NULL	100	60	100	60
      
      1. HIVE-3411.1.patch.txt
        90 kB
        Navis
      2. HIVE-3411.2.patch.txt
        133 kB
        Navis
      3. HIVE-3411.D5169.5.patch
        89 kB
        Phabricator
      4. HIVE-3411.D5169.6.patch
        89 kB
        Phabricator

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Navis
              Reporter:
              Navis
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development