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/16 08:54:12 UTC

[jira] [Created] (DRILL-4677) Cast to TIMESTAMP within value constructor results in IllegalArgumentException

Khurram Faraaz created DRILL-4677:
-------------------------------------

             Summary: Cast to TIMESTAMP within value constructor results in IllegalArgumentException
                 Key: DRILL-4677
                 URL: https://issues.apache.org/jira/browse/DRILL-4677
             Project: Apache Drill
          Issue Type: Bug
          Components: Execution - Data Types
    Affects Versions: 1.7.0
         Environment: 4 node cluster CentOS
            Reporter: Khurram Faraaz


Cast string to TIMESTAMP inside value constructor results in  IllegalArgumentException

Drill version : 1.7.0-SNAPSHOT, commit ID : 09b26277

{noformat}
0: jdbc:drill:schema=dfs.tmp> SELECT tmstmp FROM (
. . . . . . . . . . . . . . > VALUES(cast('2015-04-22 11:35:17.387006' as TIMESTAMP)))
. . . . . . . . . . . . . . > tbl(tmstmp);
Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "2015-04-22 11:35:17.387006" is malformed at "006"

Fragment 0:0

[Error Id: e793c5e5-8abc-4a4a-9951-a5c9069d600c on centos-01.qa.lab:31010] (state=,code=0)
{noformat}

When used with out CAST to TIMESTAMP, Drill returns correct results.
{noformat}
0: jdbc:drill:schema=dfs.tmp> SELECT tmstmp FROM (
. . . . . . . . . . . . . . >  VALUES('2015-04-22 11:35:17.387006'))
. . . . . . . . . . . . . . > tbl(tmstmp);
+-----------------------------+
|           tmstmp            |
+-----------------------------+
| 2015-04-22 11:35:17.387006  |
+-----------------------------+
1 row selected (0.547 seconds)
{noformat}

Results from postgres for above query, note that there is a cast to timestamp used in query.

{noformat}
postgres=# SELECT tmstmp FROM (VALUES(cast('2015-04-22 11:35:17.387006' as TIMESTAMP))) tbl(tmstmp);
           tmstmp           
----------------------------
 2015-04-22 11:35:17.387006
(1 row)

{noformat}



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