尝试从配置单元外部表中查找字符串中列时间戳的最大值和最小值

时间:2018-10-24 19:58:13

标签: hive hiveql unix-timestamp

尝试在配置单元外部表中以字符串形式查找列时间戳的最大值和最小值,查询为

SELECT cast(max(from_unixtime(unix_timestamp('timestamp','yyyy-MM-dd HH:mm:ss'))) AS timestamp) Maxts, 
    cast(min(from_unixtime(unix_timestamp('timestamp','yyyy-MM-dd HH:mm:ss'))) AS timestamp) Mints
FROM cosmos_marketplace_core_computeusage

我得到的结果是

maxts      mints

null       null

0 个答案:

没有答案