[
https://issues.apache.org/jira/browse/DRILL-4677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Volodymyr Vysotskyi resolved DRILL-4677.
----------------------------------------
Resolution: Cannot Reproduce
Fix Version/s: 1.16.0
This issue is not reproducible on current master.
> 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
> Priority: Major
> Fix For: 1.16.0
>
>
> 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
(v7.6.3#76005)