【发布时间】:2018-07-26 17:44:15
【问题描述】:
我有一个带有 string 的“日期”列,例如 April 25, 2018,我需要将其转换为时间戳值。
我可以使用 Impala 编辑器通过以下查询进行转换:
SELECT to_timestamp(concat(substr(`date`,1,3), ' ', lpad(split_part(`date`, ' ', 2), 3, '0'), ' ', split_part(`date`, ' ', 3)), 'MMM dd, yyyy') as `date`
from A
但是当我使用 Hive 编辑器时,此查询失败并出现错误:
“无效的函数‘split_part’”
如何在 Hive/Hue 编辑器中将此字符串转换为时间戳?
【问题讨论】:
-
输出应该是什么样的?