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

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: Impala 2.12.0
    • Fix Version/s: Impala 3.2.0
    • Component/s: None
    • Labels:
    • Epic Color:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: