You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Krystal (JIRA)" <ji...@apache.org> on 2015/04/21 23:13:01 UTC

[jira] [Closed] (DRILL-1165) Cast a varchar timestamp into date fails

     [ https://issues.apache.org/jira/browse/DRILL-1165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Krystal closed DRILL-1165.
--------------------------

Close as invalid.

> Cast a varchar timestamp into date fails 
> -----------------------------------------
>
>                 Key: DRILL-1165
>                 URL: https://issues.apache.org/jira/browse/DRILL-1165
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Krystal
>             Fix For: 0.4.0
>
>
> git.commit.id.abbrev=e5c2da0
> I have the following varchar data casted as timestamp:
> 0: jdbc:drill:schema=dfs> select cast(create_time as timestamp) from student where student_id=15;
> +------------+
> |   EXPR$0   |
> +------------+
> | 2014-11-12 12:38:15.0 |
> I can cast the varchar data to a date:
> 0: jdbc:drill:schema=dfs> select cast(create_time as date) from student where student_id=15;
> +------------+
> |   EXPR$0   |
> +------------+
> | 2014-11-12 |
> +------------+
> However, it fails when I tried to cast it to a time:
> 0: jdbc:drill:schema=dfs> select cast(create_time as time) from student where student_id=15;
> message: "Failure while running fragment. < IllegalArgumentException:[ Invalid format: "2014-11-12 12:38:15" is malformed at "14-11-12 12:38:15" ]"
> If it works for date, it should work for time.  This query returned the time portion of the string when executed from postgres.



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