You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Khurram Faraaz (JIRA)" <ji...@apache.org> on 2016/05/20 11:04:12 UTC

[jira] [Created] (DRILL-4689) Need to support conversion from TIMESTAMP type to TIME type

Khurram Faraaz created DRILL-4689:
-------------------------------------

             Summary: 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)