hive:sqoop导数据到hive,时间日期格式变为时间戳处理方式

7 篇文章 0 订阅
以下是两种不同格式:
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  
	cs.cno,
	o.fullname,
	bb.name  office,
	bt.name team,
    cs.enterprise_id,
   
   -- 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 join ods.employees o
    on cs.cno=o.exttel
    left join ods.branchs bb
    on bb.number=regexp_replace(regexp_replace(o.branchno, '\\{', ''), '\\}', '')
    left join ods.teams bt 
    --on o.teamsno=bt.number
    on bt.number=regexp_replace(regexp_replace(o.teamsno, '\\{', ''), '\\}', '')
    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
    cs.cno,
    cs.enterprise_id,
    o.branchno,
    cs.call_date,
  o.fullname,
  bb.name,
  bt.name 
 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值