我想在没有毫秒的情况下在Hive中使用Hive的时间戳柱。
如果时间戳是Epoch Unix时间(1970年),则时间戳将损坏:
start_date = 1915-07-15 23:25:26.290448384
select ID, START_DATE, MD5(START_DATE) from TABLE1
结果:start_date = 2500-02-02-02 00:00:00:00:00.0
没有添加MD5功能,或者Timestamp> 1970年。
我已经尝试了使用矢量化参数(),但仍然存在同一问题。
还尝试了:在MD5之前用作字符串,substr ...。
我们如何处理时间戳< 1970年?
I want to md5 a timestamp column in Hive, without the millisecond.
If timestamp is before Epoch Unix Time (year 1970), timestamp is corrupted:
START_DATE=1915-07-15 23:25:26.290448384
select ID, START_DATE, MD5(START_DATE) from TABLE1
Result : START_DATE = 2500-02-02 00:00:00.0
No issue without adding MD5 function, or if the timestamp > 1970.
I've tried with vectorized parameter (https://cwiki.apache.org/confluence/display/hive/vectorized+query+execution#VectorizedQueryExecution-Limitations) but still the same issue.
Also tried : Cast as string, substr... before MD5.
How can we handle timestamp < 1970 ?
发布评论
评论(1)
您可以使用这样的人吗?
UNIXTime将计算1970年之前的任何日期为负数,并相应地计算。所以我认为应该没事的。
can you use somethign like this ?
Unixtime will calculate any date before 1970 as negative number and calculate accordingly. so i think it should be alright.