【发布时间】:2018-12-27 23:25:44
【问题描述】:
我的需求实在是太傻了,所以基本上我需要在Hive的一个时间戳列中回溯24小时。
到目前为止,我已经尝试了两种不同的方法,但都没有成功:
select
recordDate, --original date
cast(date_sub(cast(recorddate as timestamp),1) as timestamp), -- going one day behind without hour
cast((cast(cast(recorddate as timestamp) AS bigint)-1*3600) as timestamp) -- crazy year
from mtmbuckets.servpro_agents_events limit 10;
我的输出看起来:
感谢您给予我的支持。
谢谢
【问题讨论】:
标签: datetime bigdata hiveql hue