我有timestamp列,但该列是string数据类型,但它包含十六进制格式的实际日期值,如下所示。如何使用配置单元将此十六进制日期值转换为日期值0x0000003d02e2ce75 0x0000000945eb44ae 0x0000000945eb44b0 0x0000000945eb44d3 0x00000008a11f0e9a 0x00000008a11f0ecf
wecizke31#
可以使用此选项(对于hive 1.1,使用regexp\u replace而不是replace):
select from_utc_timestamp(cast(conv(replace('0x00000008A11F0ECF', 'x', '0'), 16, 10) as bigint), 'PST')
select
from_utc_timestamp(cast(conv(replace('0x00000008A11F0ECF', 'x', '0'), 16, 10) as bigint), 'PST')
1条答案
按热度按时间wecizke31#
可以使用此选项(对于hive 1.1,使用regexp\u replace而不是replace):