【发布时间】:2017-01-10 06:18:05
【问题描述】:
您好,我正在尝试使用以下查询提取 hive 中时间戳列的月份和年份部分
select from_unixtime(unix_timestamp(upd_gmt_ts,'yyyyMM')) from abc.test;
输出看起来像 2016-05-20 01:08:48
所需的输出应该是 201605
感谢任何建议。
【问题讨论】:
-
查看
select date_format(upd_gmt_ts,'yyyyMM') from abc.test;
标签: date hadoop hive sql-timestamp