[
https://issues.apache.org/jira/browse/DRILL-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15263498#comment-15263498
]
Sean Hsuan-Yi Chu commented on DRILL-4507:
------------------------------------------
Just submitted a PR.
> TO_TIMESTAMP does not generate TIMESTAMP data type in metadata
> --------------------------------------------------------------
>
> Key: DRILL-4507
> URL: https://issues.apache.org/jira/browse/DRILL-4507
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Data Types
> Affects Versions: 1.5.0
> Reporter: Ian Hellstrom
> Assignee: Sean Hsuan-Yi Chu
>
> When creating a view that contains the TO_TIMESTAMP() casting function, the
> resulting column does not show up as a TIMESTAMP but rather as data type ANY:
> {code}
> CREATE VIEW timestamp_test AS SELECT TO_TIMESTAMP('2008-2-23 12:00:00',
> 'yyyy-MM-dd HH:mm:ss') FROM (VALUES(1));
> DESCRIBE timestamp_test;
> {code}
> yields:
> {code}
> +--------------+------------+--------------+
> | COLUMN_NAME | DATA_TYPE | IS_NULLABLE |
> +--------------+------------+--------------+
> | EXPR$0 | ANY | YES |
> +--------------+------------+--------------+
> {code}
> The same is true when using TO_DATE and SUBSTR.
> Explicit casts with CAST(ts AS TIMESTAMP) or CAST(str AS VARCHAR(10)) work as
> expected.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)