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

Incorrect results: nested types with many join types

    XMLWordPrintableJSON

Details

    Description

      The following query returns 10 rows.

      SELECT 
        * 
      FROM (
        SELECT
          a4.pos, a3.value, a1.key
        FROM
          table_1.field_18 a1
          RIGHT JOIN table_3.field_90.field_92 a2 ON ((a2.key) = (a1.key)) AND ((a2.key) = (a1.key))
          LEFT JOIN a2.value a3 ON ((((a3.key) = (a1.key)) AND ((a3.key) = (a2.key))) AND ((a3.key) = (a2.key))) AND ((a3.key) = (a1.key))
          INNER JOIN a1.value.item a4 ON ((a4.pos) = (a3.value)) AND ((a4.pos) = (a3.value))
      ) a5
      WHERE
        a5.pos = 2 and a5.key = ""
      

      However, the number of rows that look like (2, 2, "") is only 9 in the following query. (it should be 10). Also the query should return 98 rows instead of 96 like it currently does.

      SELECT
        a4.pos, a3.value, a1.key
      FROM
        table_1.field_18 a1
        RIGHT JOIN table_3.field_90.field_92 a2 ON ((a2.key) = (a1.key)) AND ((a2.key) = (a1.key))
        LEFT JOIN a2.value a3 ON ((((a3.key) = (a1.key)) AND ((a3.key) = (a2.key))) AND ((a3.key) = (a2.key))) AND ((a3.key) = (a1.key))
        INNER JOIN a1.value.item a4 ON ((a4.pos) = (a3.value)) AND ((a4.pos) = (a3.value))
      

      To reproduce:

      ssh dev@vd0206.halxg.cloudera.com -p 22222 (pw: cloudera)
      db name: random_nested_db_0;
      

      Attachments

        1. probe_batch_log.patch
          2 kB
          Tim Armstrong

        Activity

          People

            alex.behm Alexander Behm
            tarasbob Taras Bobrovytsky
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: