You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Sean Hsuan-Yi Chu (JIRA)" <ji...@apache.org> on 2015/10/23 20:12:28 UTC

[jira] [Created] (DRILL-3971) to_date(timestamp) is supported

Sean Hsuan-Yi Chu created DRILL-3971:
----------------------------------------

             Summary: to_date(timestamp) is supported 
                 Key: DRILL-3971
                 URL: https://issues.apache.org/jira/browse/DRILL-3971
             Project: Apache Drill
          Issue Type: Task
          Components: Documentation
            Reporter: Sean Hsuan-Yi Chu
            Assignee: Kristine Hahn


Do a search for "to_date" in this link:
https://drill.apache.org/docs/data-type-conversion/

We would find that it says these two are supported:
1. expression is a character string enclosed... (rest is omitted)
2. 'format' is a format specifier enclosed... (rest is omitted)

Due to DRILL-3769, let's add one more supported case: expression can be timp_stamp type. 

A example would be:
{code }
0: jdbc:drill:zk=local> select to_date(to_timestamp(1000000000)) from (VALUES(1));
+-------------+
|   EXPR$0    |
+-------------+
| 2001-09-09  |
+-------------+
{code }
Note that to_timestamp(1000000000) would generate a timestamp with value 2001-09-08 18:46:40.0 (on MAC, which can be different on Linux )



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)