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

wrong results when comparing timestamp casted to varchar of smaller length to a string literal in a binary predicate

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 2.12.0
    • Impala 3.2.0
    • None
    • ghx-label-9

    Description

      Expression rewriting seems to identify this as a redundant cast and removes it.

      Steps to re-create:

      select * from (select cast('2018-12-11 09:59:37' as timestamp) as ts) tbl where cast(ts as varchar(10)) = '2018-12-11';
      

      output:

      Fetched 0 row(s) 
      

      Now disable expression re-writes.

      set ENABLE_EXPR_REWRITES=false;
      select * from (select cast('2018-12-11 09:59:37' as timestamp) as ts) tbl where cast(ts as varchar(10)) = '2018-12-11';
      

      output:

      +---------------------+
      | ts                  |
      +---------------------+
      | 2018-12-11 09:59:37 |
      +---------------------+
      

      Attachments

        Issue Links

          Activity

            People

              bikramjeet.vig Bikramjeet Vig
              bikramjeet.vig Bikramjeet Vig
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: