Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-3071

Incorrect assignment of inner join on-clause predicate that references an outer-joined table.

    XMLWordPrintableJSON

    Details

      Description

      Query and incorrect plan:

      select 1 from functional.alltypestiny a
      left outer join functional.alltypestiny b
        on a.id = b.id
      inner join functional.alltypestiny c
        on b.int_col < 0
      
      +----------------------------------------------------------+
      | Explain String                                           |
      +----------------------------------------------------------+
      | Estimated Per-Host Requirements: Memory=64.00MB VCores=2 |
      |                                                          |
      | 07:EXCHANGE [UNPARTITIONED]                              |
      | |                                                        |
      | 04:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]              |
      | |                                                        |
      | |--06:EXCHANGE [BROADCAST]                               |
      | |  |                                                     |
      | |  02:SCAN HDFS [functional.alltypestiny c]              |
      | |     partitions=4/4 files=4 size=460B                   |
      | |                                                        |
      | 03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]                |
      | |  hash predicates: a.id = b.id         <-- b.int_col < 0 should also be in otherPredicates                 |
      | |                                                        |
      | |--05:EXCHANGE [BROADCAST]                               |
      | |  |                                                     |
      | |  01:SCAN HDFS [functional.alltypestiny b]              |
      | |     partitions=4/4 files=4 size=460B                   |
      | |     predicates: b.int_col < 0                          |
      | |                                                        |
      | 00:SCAN HDFS [functional.alltypestiny a]                 |
      |    partitions=4/4 files=4 size=460B                      |
      +----------------------------------------------------------+
      

      The result set should clearly be empty because there are no rows that satisfy b.int_col < 0, but the returned result set is non-empty.

        Attachments

          Activity

            People

            • Assignee:
              alex.behm Alexander Behm
              Reporter:
              alex.behm Alexander Behm
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: