Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
Impala 2.1
-
None
Description
When casting strings to timestamps, it should not be necessary to left pad values with zeros.
From the ANSI SQL/foundation spec
<date value> ::= <years value> <minus sign> <months value> <minus sign> <days value> <time value> ::= <hours value> <colon> <minutes value> <colon> <seconds value>
Examples that do not work that should
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 | +------+
Attachments
Issue Links
- duplicates
-
IMPALA-926 Support more timestamp formats in casts
- Resolved
- is related to
-
IMPALA-5315 Cast to timestamp fails for YYYY-M-D format
- Resolved
- relates to
-
IMPALA-4017 support ANSI timestamp literal casts
- Open
-
IMPALA-4018 Add support for SQL:2016 datetime templates/patterns/masks to CAST(... AS ... FORMAT <template>)
- Closed