Details
Description
I need to format a date as 2017-04-20H18. No amount of backslashes or ticks will get this done.
In hive, it looks like:
hive> select from_unixtime(1492677561,'yyyy-MM-dd\'H\'HH'); OK _c0 2017-04-20H08
In impala, the same query returns the wrong thing. Instead of a literal H, it gives me '8' (because the hour happens to be 8).
[atl1c1mgr-vip.vldb-bo.secureworks.net:21001] > select from_unixtime(1492677561,'yyyy-MM-dd\'H\'HH'); Query: select from_unixtime(1492677561,'yyyy-MM-dd\'H\'HH') +------------------------------------------------+ | from_unixtime(1492677561, 'yyyy-mm-dd\'h\'hh') | +------------------------------------------------+ | 2017-04-20'8'08 | +------------------------------------------------+ Fetched 1 row(s) in 0.05s
from_unixtime should support literals. My preference would be that it uses the same syntax as hive to achieve this.
Attachments
Issue Links
- relates to
-
IMPALA-3381 Impala to support AM/PM format in unix_timestamp and from_unixtime
- Closed
1.
|
Impala Doc: from_unixtime supports literal H | Open | Unassigned |