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

Impala Timestamp ISO-8601 Support

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Impala 2.2
    • Fix Version/s: Impala 2.2.2
    • Component/s: None

      Description

      We have several data sources that return dates in ISO-8601 format. Following IMPALA-648, we are closer to having these convertable to timestamp without effort, but time zones are still not supported:

      Query: select cast('2011-04-13T16:55:02.000Z' as timestamp), cast ('2011-04-13T16:55:02.000' as timestamp), cast('2011-04-13T16:55:02.000+00:00' as timestamp)
      +-----------------------------------------------+----------------------------------------------+----------------------------------------------------+
      | cast('2011-04-13t16:55:02.000z' as timestamp) | cast('2011-04-13t16:55:02.000' as timestamp) | cast('2011-04-13t16:55:02.000+00:00' as timestamp) |
      +-----------------------------------------------+----------------------------------------------+----------------------------------------------------+
      | NULL                                          | 2011-04-13 16:55:02                          | NULL                                               |
      +-----------------------------------------------+----------------------------------------------+----------------------------------------------------+
      

      Neither format with a time zone specifier will parse even though they are valid based on my understanding of ISO-8601 and http://en.wikipedia.org/wiki/ISO_8601

      For now we have worked around this by converting with substring to cut off the time zone identifier, but I'm not sure which time zone the dates will be interpreted in. If I cut off the Z, will my dates be parsed in server local time?

      Ideally, we should be able to cast dates with time zone specifiers to timestamps with cast easily.

        Attachments

          Activity

            People

            • Assignee:
              jyu@cloudera.com Juan Yu
              Reporter:
              alanj_impala_5a78 Alan Jackoway
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: