drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Matta <cma...@mapr.com>
Subject Convert ISO 8601 string to timestamp
Date Wed, 03 Feb 2016 17:40:36 GMT
What’s the best way to convert this ISO 8601 timestamp to a drill timestamp
type?

Tried this:

0: jdbc:drill:> select to_timestamp('2016-01-08T15:00:15-05:00') from
sys.version;
Error: SYSTEM ERROR: DrillRuntimeException: Failure while
materializing expression in constant expression evaluator
[TO_TIMESTAMP('2016-01-08T15:00:15-05:00')].  Errors:
Error in expression at index -1.  Error: Missing function
implementation: [castTINYINT(VARCHAR-REQUIRED)].  Full expression:
--UNKNOWN EXPRESSION--.

[Error Id: 85cfdbb6-3b60-44a6-922c-acec0b5e1c18 on
se-node11.se.lab:31010] (state=,code=0)

and this:

0: jdbc:drill:> select to_timestamp('2016-01-08T15:00:15-05:00',
'yyyy-MM-ddTHH:mm:ssZ') from sys.version;
Error: SYSTEM ERROR: IllegalArgumentException: Illegal pattern component: T

[Error Id: b6b0cb7e-681c-4b34-a64f-788e16a7b157 on
se-node11.se.lab:31010] (state=,code=0)

How can I escape that T character? In Java I would escape it with the
single quote, but Drill won’t take that because the time format needs to be
wrapped in single quotes.

Chris Mattacmatta@mapr.com
215-701-3146
​

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message