将字符串转换为蜂巢中的日期

时间:2018-06-19 17:20:54

标签: hive hiveql

我在蜂巢中具有以下日期格式:20180618151752

进行以下查询以通过以下方式将其保留:

select
concat(substr(xdr.time_stop,1,8),' ',
substr(xdr.time_stop,9,2),':',
substr(xdr.time_stop,10,2),':',
substr(xdr.time_stop,11,2)) as date
from padl.fraude_vozm_xdr;

20180618 18:17:52

现在,我需要将该字符串字段转换为日期,我该怎么办?

谢谢

1 个答案:

答案 0 :(得分:0)

使用let Api = new Restivus({ useDefaultAuth: false, prettyJson: true, version: 'v1', enableCors: false, // or set true in production defaultOptionsEndpoint: { action: function() { this.response.writeHead(201, { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Z-Key, X-Auth-Token, X-User-Id', 'Content-Type': 'application/json', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' }); this.done(); return { status: true } } }, }); from_unixtime

unix_timestamp