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

Reuse of a column in JOIN predicate may lead to incorrect results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 2.0
    • Impala 2.0
    • None

    Description

      In the query below, the "WHERE t1.int_col = tt1.year" condition is dropped. This is very similar to other issues but Alex thinks fixing this case may be simpler.

      Query: explain 
      select straight_join 1
      FROM alltypestiny t1
      WHERE t1.int_col IN
        (SELECT tt1.year - tt1.year  AS int_col_1
         FROM alltypesagg tt1
         WHERE t1.int_col = tt1.year)
      +----------------------------------------------------------+
      | Explain String                                           |
      +----------------------------------------------------------+
      | Estimated Per-Host Requirements: Memory=80.01MB VCores=2 |
      |                                                          |
      | 05:EXCHANGE [UNPARTITIONED]                              |
      | |                                                        |
      | 02:HASH JOIN [LEFT SEMI JOIN, PARTITIONED]               |
      | |  hash predicates: t1.int_col = tt1.year - tt1.year     |
      | |                                                        |
      | |--04:EXCHANGE [HASH(tt1.year - tt1.year)]               |
      | |  |                                                     |
      | |  01:SCAN HDFS [functional.alltypesagg tt1]             |
      | |     partitions=11/11 size=814.73KB                     |
      | |                                                        |
      | 03:EXCHANGE [HASH(t1.int_col)]                           |
      | |                                                        |
      | 00:SCAN HDFS [functional.alltypestiny t1]                |
      |    partitions=4/4 size=460B                              |
      +----------------------------------------------------------+
      Fetched 16 row(s) in 0.02s
      

      Attachments

        Activity

          People

            alex.behm Alexander Behm
            caseyc casey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: