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

Inconsistent results when comparing string and timestamp fields

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: Impala 2.7.0
    • Fix Version/s: Impala 2.10.0
    • Component/s: Frontend
    • Labels:
    • Environment:
      CDH 5.10.1

      Description

      create table t1 (c1 string, c2 string);
      insert into t1 values ('a string', '2017-01-01');
      create table t2 (c1 string) partitioned by (c2 string);
      insert into t2 partition (c2) values ('a string', '2017-01-01');
      

      This correctly returns 1 row

      select * from t1 where c2 = cast('2017-01-01' as timestamp);
      

      This incorrectly returns 0 rows

      select * from t2 where c2 = cast('2017-01-01' as timestamp);
      

      These 2 queries correctly return 1 row.

      select * from t1 where c2 >= date_sub('2017-01-01', 1) and c2 <= '2017-01-02'; 
      select * from t2 where c2 >= date_sub('2017-01-01', 1) and c2 <= '2017-01-02'; 
      

      This queries behave differently. The 2nd query returns 0 rows:

      select * from t1 where c2 between date_sub('2017-01-01', 1) and '2017-01-02'; 
      select * from t2 where c2 between date_sub('2017-01-01', 1) and '2017-01-02'; 
      

      This bug was not present in version:
      Server version: impalad version 2.6.0-cdh5.8.2 RELEASE (build f25aa5b2bcdabf1eb4233747a7b04a067059ee3b)"

      But is present in version:
      Server version: impalad version 2.7.0-cdh5.10.1 RELEASE (build 876895d2a90346e69f2aea02d5528c2125ae7a32)

        Attachments

          Activity

            People

            • Assignee:
              mjacobs Matthew Jacobs
              Reporter:
              nbrenwald Nicholas Brenwald
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: