You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Greg Rahn (JIRA)" <ji...@apache.org> on 2017/06/20 22:34:00 UTC
[jira] [Closed] (IMPALA-1734) cast( as timestamp) should
not require zero padded elements
[ https://issues.apache.org/jira/browse/IMPALA-1734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Rahn closed IMPALA-1734.
-----------------------------
Resolution: Duplicate
Closing as duplicate of IMPALA-5315
> cast(<string> as timestamp) should not require zero padded elements
> -------------------------------------------------------------------
>
> Key: IMPALA-1734
> URL: https://issues.apache.org/jira/browse/IMPALA-1734
> Project: IMPALA
> Issue Type: Improvement
> Affects Versions: Impala 2.1
> Reporter: Denys Lamanov
> Labels: usability
> Fix For: Product Backlog
>
>
> When casting strings to timestamps, it should not be necessary to left pad values with zeros.
> From the ANSI SQL/foundation spec
> {code}
> <date value> ::=
> <years value> <minus sign> <months value> <minus sign> <days value>
> <time value> ::=
> <hours value> <colon> <minutes value> <colon> <seconds value>
> {code}
> h4.Examples that do not work that should
> {code}
> select version()
> +-----------------------------------------------------------------------------------------+
> | version() |
> +-----------------------------------------------------------------------------------------+
> | impalad version 2.6.0-cdh5.8.0 RELEASE (build 5464d1750381b40a7e7163b12b09f11b891b4de3) |
> | Built on Thu, 16 Jun 2016 12:43:48 PST |
> +-----------------------------------------------------------------------------------------+
> select cast('2015-1-01' as timestamp) as ts;
> +------+
> | ts |
> +------+
> | NULL |
> +------+
> select cast('2015-01-1' as timestamp) as ts;
> +------+
> | ts |
> +------+
> | NULL |
> +------+
> select cast('2016-1-1 9:5:7' as timestamp) as ts
> +------+
> | ts |
> +------+
> | NULL |
> +------+
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)