Hi Divya,

Default timestamp format for Drill is 'YYYY-MM-DD HH:MI:SS'.
For the cases, when you want to get a timestamp from a string with another
format, date pattern should be specified.

Drill allows using both Jodatime patterns (to_date, to_time, to_timestamp
functions, see allowed patterns at [1])
and sql-like patterns (sql_to_date, sql_to_time, sql_to_timestamp
functions, see allowed patterns at [2])

[1]
http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html
[2] https://issues.apache.org/jira/browse/DRILL-4864

2017-12-14 10:17 GMT+02:00 Arjun kr <arjun...@outlook.com>:

> Pls see if this works for you.
>
>
> 0: jdbc:drill:schema=dfs> SELECT TO_TIMESTAMP('Sun Apr 1 00:00:01 UTC
> 2018', 'E MMM d HH:mm:ss z yyyy') FROM (VALUES(1));
> +------------------------+
> |         EXPR$0         |
> +------------------------+
> | 2018-04-01 00:00:01.0  |
> +------------------------+
> 1 row selected (0.165 seconds)
> 0: jdbc:drill:schema=dfs>
>
>
>
> Thanks,
>
> Arjun kr
>
> ________________________________
> From: Divya Gehlot <divya.htco...@gmail.com>
> Sent: Thursday, December 14, 2017 9:12 AM
> To: user@drill.apache.org
> Subject: Illegal Argument Exception while convert unix date format to
> drill timestamp
>
> Hi,
> Does Drill supprts to convert Unix date format to Drill timstamp ?
>
> Unix TimeStamp : Thu Dec 14 03:40:50 UTC 2017
> When I Cast to Drill time stamp I get Illegal Argument Exception.
>
>
> Thanks,
> Divya
>



-- 
Kind regards,
Volodymyr Vysotskyi

Reply via email to