Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 0.3
-
None
-
None
-
None
Description
Impala's UNIX_TIMESTAMP(val, format) operation compares the length of format and val and returns NULL if they do not match. Hive instead effectively truncates val to format's length.
For example, in Hive:
hive> select UNIX_TIMESTAMP('2000-02-01 10:20:30','yyyy-MM') FROM tmp; <snip> OK 949392000
hive> select UNIX_TIMESTAMP('2000-02-01 10:20:30','yyyy') FROM tmp; <snip> OK 946713600 <<< Note that value has changed since the format truncated the string to just '2000'
hive> select UNIX_TIMESTAMP('2000-02-01 10:20:30 junk text','yyyy') FROM tmp; <snip> OK 946713600 <<< Still works! Garbage string is ignored.