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

Incorrect results joining on modulo condition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Duplicate
    • Impala 2.5.0
    • None
    • Backend

    Description

      I was messing around with a table on the nightly cluster and came across a very strange result. It was a little difficult to repro using the functional db but I think the query below has the same problem.

      [localhost:21000] > use functional_parquet;
      Query: use functional_parquet
      
      [localhost:21000] > select c.id, cc.id from complextypestbl c join complextypestbl cc on (cc.id % 2) = (c.id % 2);
      Query: select c.id, cc.id from complextypestbl c join complextypestbl cc on (cc.id % 2) = (c.id % 2)
      +----+----+
      | id | id |
      +----+----+
      | 1  | 7  |
      | 1  | 5  |
      | 1  | 3  |
      | 1  | 1  |
      +----+----+
      Fetched 4 row(s) in 0.12s
      

      The result doesn't make sense because the query is symmetrical.

      I think this only happens when using a nested table? Also the table might need to be small. Not sure about those things though.

      Version:

      ☁  Impala  git log -1
      commit 31f005c269c584f01662cc8e68b8a440fbc21fca
      

      Here is the query from the nightly cluster that is more obviously wrong:

      [nightly-3.vpc.cloudera.com:21000] > select count(*) from customers c join customers cc on c.id = cc.id ;
      Query: select count(*) from customers c join customers cc on c.id = cc.id
      +----------+
      | count(*) |
      +----------+
      | 53       |
      +----------+
      Fetched 1 row(s) in 0.68s
      
      [nightly-3.vpc.cloudera.com:21000] > select count(*) from customers c join customers cc on (c.id % 2) = (cc.id % 2);
      Query: select count(*) from customers c join customers cc on (c.id % 2) = (cc.id % 2)
      +----------+
      | count(*) |
      +----------+
      | 0        |
      +----------+
      Fetched 1 row(s) in 0.69s
      
      [nightly-3.vpc.cloudera.com:21000] > version();
      Shell version: Impala Shell v2.5.0-cdh5-INTERNAL (31f005c) built on Sun Feb 21 04:23:38 PST 2016
      Server version: impalad version 2.5.0-cdh5-INTERNAL RELEASE (build 31f005c269c584f01662cc8e68b8a440fbc21fca)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            caseyc casey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: