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

Wrong results with outer joins in inline views

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.0
    • Impala 2.1
    • None

    Description

      A wrong plan is generated for the following query that contains an inline view with an outer join:

      create table table_a (lac int, ci int);
      create table table_b (lac int, ci int);
      
      insert into table_a values (100, 1);
      insert into table_a values (200, 2);
      insert into table_a values (300, NULL);
      
      insert into table_b values (200, 2);
      
      Query: explain select t.* from
      (
      select a.lac a_lac, a.ci a_ci, b.lac b_lac, b.ci b_ci from
      table_a a
      left outer join
      table_b b
      on a.lac = b.lac and a.ci = b.ci
      ) t
      +------------------------------------------------------------------------------------+
      | Explain String                                                                     |
      +------------------------------------------------------------------------------------+
      | Estimated Per-Host Requirements: Memory=2.03GB VCores=2                            |
      | WARNING: The following tables are missing relevant table and/or column statistics. |
      | default.table_a, default.table_b                                                   |
      |                                                                                    |
      | 04:EXCHANGE [UNPARTITIONED]                                                        |
      | |                                                                                  |
      | 02:HASH JOIN [LEFT OUTER JOIN, BROADCAST]                                          |
      | |  hash predicates: a.lac = b.lac, a.ci = b.ci                                     |
      | |  other predicates: a.lac = b.lac, a.ci = b.ci                                    |
      | |                                                                                  |
      | |--03:EXCHANGE [BROADCAST]                                                         |
      | |  |                                                                               |
      | |  01:SCAN HDFS [default.table_b b]                                                |
      | |     partitions=1/1 size=6B                                                       |
      | |                                                                                  |
      | 00:SCAN HDFS [default.table_a a]                                                   |
      |    partitions=1/1 size=19B                                                         |
      +------------------------------------------------------------------------------------+
      

      Attachments

        Activity

          People

            dtsirogiannis Dimitris Tsirogiannis
            dtsirogiannis Dimitris Tsirogiannis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: