hive> select from_unixtime(1564581347,'yyyy-MM-dd HH:mm:ss') ;
OK
2019-07-31 21:55:47
Time taken: 0.168 seconds, Fetched: 1 row(s)
hive> select from_unixtime( cast(1564581347793/1000 as int),'yyyy-MM-dd HH:mm:ss') ; --13位的需要这样处理
OK
2019-07-31 21:55:47
Time taken: 0.421 seconds, Fetched: 1 row(s)
hive> select from_unixtime(1564581347793/1000,'yyyy-MM-dd HH:mm:ss') ;
FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments ''yyyy-MM-dd HH:mm:ss'': No matching method for class org.apache.hadoop.hive.ql.udf.UDFFromUnixTime with (double, string). Possible choices: _FUNC_(bigint) _FUNC_(bigint, string) _FUNC_(int) _FUNC_(int, string)
hive>
Hive 时间戳转换为日期时间
最新推荐文章于 2024-03-05 16:47:45 发布