Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Cannot Reproduce
-
0.9.0
-
None
-
None
-
Ubuntu LTS 10.04
Description
When attempting to convert a UNIX timestamp to UTC the conversion fails if the input does not include micro or nano seconds:
SELECT to_utc_timestamp(unix_timestamp('27/Sep/2012:09:53:35','dd/MMM/yyyy:HH:mm:ss'),'America/Denver') FROM source_table LIMIT 1;
1970-01-16 14:39:21.215
"Converting" to a float provides a workaround:
SELECT to_utc_timestamp(unix_timestamp('27/Sep/2012:09:53:35','dd/MMM/yyyy:HH:mm:ss') * 1.0,'America/Denver') FROM source_table LIMIT 1;
2012-09-27 15:53:35.0
As does "adding" nano seconds:
SELECT to_utc_timestamp(unix_timestamp('27/Sep/2012:09:53:35','dd/MMM/yyyy:HH:mm:ss') * 1000,'America/Denver') FROM source_table LIMIT 1;
2012-09-27 15:53:35.0
This problem may be at the heart of HIVE-3454 as well.
Documentation here: https://cwiki.apache.org/Hive/languagemanual-types.html#LanguageManualTypes-Timestamps