drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Hyde (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4689) Need to support conversion from TIMESTAMP type to TIME type
Date Fri, 20 May 2016 14:55:12 GMT

    [ https://issues.apache.org/jira/browse/DRILL-4689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293474#comment-15293474
] 

Julian Hyde commented on DRILL-4689:
------------------------------------

I support converting TIMESTAMP to TIME, but a TIME literal needs to be in the correct format,
regardless of what PostgreSQL does.

> Need to support conversion from TIMESTAMP type to TIME type
> -----------------------------------------------------------
>
>                 Key: DRILL-4689
>                 URL: https://issues.apache.org/jira/browse/DRILL-4689
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>    Affects Versions: 1.7.0
>         Environment: CentOS cluster
>            Reporter: Khurram Faraaz
>
> According to ISO/IEC-2 9075 standard, TIMESTAMP type to TIME type conversion is allowed
and supported.
> This does not seem to work on Drill 1.7.0
> {noformat}
> 0: jdbc:drill:schema=dfs.tmp> values(TIME '2050-2-3 10:11:12.1000');
> Error: PARSE ERROR: Illegal TIME literal '2050-2-3 10:11:12.1000': not in format 'HH:mm:ss'
> SQL Query values(TIME '2050-2-3 10:11:12.1000')
>        ^
> [Error Id: 77168fe0-760f-4384-a7c6-682241675348 on centos-03.qa.lab:31010] (state=,code=0)
> 0: jdbc:drill:schema=dfs.tmp> values(cast('2050-2-3 10:11:12.1000' as time));
> Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "2050-2-3 10:11:12.1000"
is malformed at "50-2-3 10:11:12.1000"
> Fragment 0:0
> [Error Id: 5168dfe6-b5e5-4ce0-8570-02ea74da6367 on centos-03.qa.lab:31010] (state=,code=0)
> 0: jdbc:drill:schema=dfs.tmp>
> {noformat}
> The above two expressions are supported on Postgres 9.3
> {noformat}
> postgres=# values(TIME '2050-2-3 10:11:12.1000');
>   column1   
> ------------
>  10:11:12.1
> (1 row)
> postgres=# values(cast('2050-2-3 10:11:12.1000' as time));
>   column1   
> ------------
>  10:11:12.1
> (1 row)
> postgres=# 
> {noformat}



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

Mime
View raw message