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

Union with constant exprs inside a subplan returns inconsistent results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 2.9.0
    • Impala 2.10.0
    • Backend
    • ghx-label-1

    Description

      The follow queries returned wrong results

      select c_custkey, o_orderkey from tpch_nested_parquet.customer c,
        (select o_orderkey from c.c_orders
         union all
         values(100), (200), (300)) v
      where c_custkey in (1, 2, 3)
      Query submitted at: 2017-06-01 23:08:25 (Coordinator: http://anuj-OptiPlex-9020:25000)
      Query progress can be monitored at: http://anuj-OptiPlex-9020:25000/query_plan?query_id=4d4822d9721bd930:bedfd0d800000000
      +-----------+------------+
      | c_custkey | o_orderkey |
      +-----------+------------+
      | 3         | 100        |
      | 3         | 200        |
      | 3         | 300        |
      | 1         | 579908     |
      | 1         | 4808192    |
      | 1         | 3868359    |
      | 1         | 4273923    |
      | 1         | 454791     |
      | 1         | 5133509    |
      | 1         | 100        |
      | 1         | 200        |
      | 1         | 300        |
      | 2         | 430243     |
      | 2         | 2992930    |
      | 2         | 1842406    |
      | 2         | 1374019    |
      | 2         | 1071617    |
      | 2         | 1763205    |
      | 2         | 3986496    |
      +-----------+------------+
      

      This should have also included the following rows in the output -
      2, 100
      2, 200
      2, 300

      This query works correctly sometimes and returns the 22 rows instead of 19 rows like above.

      Similarly,
      select c_custkey, o_orderkey from tpch_nested_parquet.customer c,
       (select o_orderkey from c.c_orders
        union all
        values(11), (22), (33),(44)) v
      where c_custkey = 2
      Query progress can be monitored at: http://anuj-OptiPlex-9020:25000/query_plan?query_id=f146eebc188c783d:518aa09100000000
      +-----------+------------+
      | c_custkey | o_orderkey |
      +-----------+------------+
      | 2         | 430243     |
      | 2         | 2992930    |
      | 2         | 1842406    |
      | 2         | 1374019    |
      | 2         | 1071617    |
      | 2         | 1763205    |
      | 2         | 3986496    |
      +-----------+------------+
      Fetched 7 row(s) in 0.23s
      

      The results are inconsistent because it also returns correct values sometimes

      Query: select c_custkey, o_orderkey from tpch_nested_parquet.customer c,
       (select o_orderkey from c.c_orders
        union all
        values(11), (22), (33),(44)) v
      where c_custkey = 2
      Query submitted at: 2017-06-05 13:33:21 (Coordinator: http://anuj-OptiPlex-9020:25000)
      Query progress can be monitored at: http://anuj-OptiPlex-9020:25000/query_plan?query_id=5b4fa6fd6a294b6c:e0afbf9b00000000
      +-----------+------------+
      | c_custkey | o_orderkey |
      +-----------+------------+
      | 2         | 430243     |
      | 2         | 2992930    |
      | 2         | 1842406    |
      | 2         | 1374019    |
      | 2         | 1071617    |
      | 2         | 1763205    |
      | 2         | 3986496    |
      | 2         | 11         |
      | 2         | 22         |
      | 2         | 33         |
      | 2         | 44         |
      +-----------+------------+
      Fetched 11 row(s) in 0.23s
      [localhost:21000] > 
      

      Attachments

        Activity

          People

            alex.behm Alexander Behm
            anujphadke Anuj Phadke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: