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

Incorrect result (join ordering)

    XMLWordPrintableJSON

Details

    Description

      Query:

      SELECT 1
      FROM table_0 t2879
      LEFT JOIN t2879.field_12 t2880 ON (t2880.pos) = (t2879.field_0.field_4)
      INNER JOIN t2880.item t2881 ON ((t2881.value) = (t2880.pos))
      

      The number of rows returned is 247, but it should be 0.

      Plan:

      +------------------------------------------------------------------------------------+
      | Explain String                                                                     |
      +------------------------------------------------------------------------------------+
      | Estimated Per-Host Requirements: Memory=96.00MB VCores=1                           |
      | WARNING: The following tables are missing relevant table and/or column statistics. |
      | random_nested_db_0.table_0                                                         |
      |                                                                                    |
      | 09:EXCHANGE [UNPARTITIONED]                                                        |
      | |                                                                                  |
      | 01:SUBPLAN                                                                         |
      | |                                                                                  |
      | |--08:NESTED LOOP JOIN [RIGHT OUTER JOIN]                                          |
      | |  |  join predicates: (t2880.pos) = (t2879.field_0.field_4)                       |
      | |  |                                                                               |
      | |  |--02:SINGULAR ROW SRC                                                          |
      | |  |                                                                               |
      | |  04:SUBPLAN                                                                      |
      | |  |                                                                               |
      | |  |--07:NESTED LOOP JOIN [INNER JOIN]                                             |
      | |  |  |  join predicates: (t2881.value) = (t2880.pos)                              |
      | |  |  |                                                                            |
      | |  |  |--05:SINGULAR ROW SRC                                                       |
      | |  |  |                                                                            |
      | |  |  06:UNNEST [t2880.item t2881]                                                 |
      | |  |                                                                               |
      | |  03:UNNEST [t2879.field_12 t2880]                                                |
      | |                                                                                  |
      | 00:SCAN HDFS [random_nested_db_0.table_0 t2879]                                    |
      |    partitions=1/1 files=1 size=32.98MB                                             |
      +------------------------------------------------------------------------------------+
      

      When the query is run with the straight_join hint, the following error is returned:

      ERROR: IllegalStateException: null
      

      To access the machine with the loaded data:

      ssh dev@vd0206.halxg.cloudera.com -p 33334 (pw: cloudera)
      run-all.sh && start-impala-cluster.py
      impala-shell.sh
      use random_nested_db_0;
      

      (core dumps are saved to /tmp/core_files)

      Attachments

        Activity

          People

            dtsirogiannis Dimitris Tsirogiannis
            tarasbob Taras Bobrovytsky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: