【问题标题】:Changing format of date field in Hive更改 Hive 中日期字段的格式
【发布时间】:2015-12-21 08:05:24
【问题描述】:

我有一个 Hive 表,其时间戳格式为 08/29/2015 0:00:08。我尝试使用 unixtimestamp 函数来隔离日期,以便我可以将其用于比较,但总是得到空值作为输出。我想我需要将格式更改为 2015-08-09 0:00:08 但不知道如何。我是 Hive 新手,因此欢迎任何指导。

【问题讨论】:

标签: date hive


【解决方案1】:

您应该使用 UDF 将它们转换为时间戳 unix_timestamp("08/29/2015 0:00:08", "dd/MM/yyyy H:mm:ss")

在这里查看帮助:http://docs.treasuredata.com/articles/hive-functions#date-functions

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    • 2019-07-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多