【发布时间】:2020-09-16 21:52:09
【问题描述】:
我正在创建以下数据框
syncs.select($"event.timestamp",to_date($"event.timestamp".cast(TimestampType))).show
这包括以下行
timestamp|to_date(CAST(`event.timestamp` AS TIMESTAMP))|
-------------+---------------------------------------------+
1589509800768| 52339-07-25|
1589509802730| 52339-07-25|
1589509809092| 52339-07-25|
1589509810402| 52339-07-25|
1589509812112| 52339-07-25|
1589509817489| 52339-07-25|
1589509818065| 52339-07-25|
1589509818902| 52339-07-25|
1589509819020| 52339-07-25|
1589509819425| 52339-07-25|
1589509819830| 52339-07-25|
基于 this 1589509800768 是 2020 年 5 月 15 日星期五 02:30:00。
我不明白为什么我会收到这些未来的日期。从时间戳到日期的转换是否也需要某种日期格式?
【问题讨论】:
标签: scala date apache-spark timestamp