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

Impala's date_sub and date_add functions are not automatically casting strings (in the correct format) to TIMESTAMP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • Impala 2.0
    • None
    • Frontend

    Description

      To reproduce:

      – This query works:
      select date_sub(now(), interval 5 minutes);

      – Get the string version of now and copy and place it below:
      select now() as now;

      – Paste in string and run this, Impala will error:
      select date_sub('2014-11-21 15:49:05.312610000', interval 5 minutes);
      – It should not error, but rather cast the string (as per the documentation:
      http://www.cloudera.com/content/cloudera/en/documentation/cloudera-impala/latest/topics/impala_timestamp.html?scroll=timestamp
      ***The first argument can be a string, which is automatically cast to TIMESTAMP if it uses the recognized format, as described in TIMESTAMP Data Type.***

      Attachments

        Issue Links

          Activity

            People

              tarmstrong Tim Armstrong
              aspencer_impala_46bf Alex Spencer
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: