hive:sqoop导数据到hive,时间⽇期格式变为时间戳处理⽅
式
以下是两种不同格式:
from_unixtime(ceil(update_time/1000),'yyyy-MM-dd HH:mm:ss')
from_unixtime(ceil(1536249600000/1000),"yyyy-MM-dd'T'HH:mm:ss'Z'")
select
cso,
o.fullname,
bb.name office,unix时间戳转换日期格式
bt.name team,
-
- call_date,
from_unixtime(ceil(cs.call_date/1000),'yyyy-MM-dd HH:mm:ss') call_date,
--from_unixtime(ceil(call_date/1000),"yyyy-MM-dd'T'HH:mm:ss'Z'"),
SUM(cs.bridge_effective_duration) bridge_effective_duration,
SUM(cs.effective_tel_count) effective_tel_count,
SUM(cs.bridge_tel_hand_count) bridge_tel_hand_count,
SUM(cs.bridge_tel_liexiaobao_count) bridge_tel_liexiaobao_count,
SUM(cs.bridge_tel_shangji_count) bridge_tel_shangji_count
from ods.stics cs
left ployees o
on l
left join ods.branchs bb
on bb.number=regexp_replace(regexp_replace(o.branchno, '\\{', ''), '\\}', '')
left ams bt
--amsno=bt.number
on bt.number=regexp_replace(regexp_amsno, '\\{', ''), '\\}', '')
WHERE
enterprise_id='7131'
AND from_unixtime(ceil(call_date/1000),'yyyy-MM-dd') >= '2019-05-01' AND from_unixtime(ceil(call_date/1000),'yyyy-MM-dd') <= '2019-05-05' GROUP BY
cso,
o.branchno,
cs.call_date,
o.fullname,
bb.name,
bt.name
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论