hive多分区写入

hive多分区写入

-- 多分区写入
set mapred.max.split.size=256000000;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.exec.max.dynamic.partitions=800;
set hive.exec.max.dynamic.partitions.pernode=800;

INSERT overwrite table ods.im_session_content_record partition(`date`)
select
-999 as source_type,
a.cid,
a.sid,
a.vccid,
a.userid,
current_timestamp as bi_update_datetime,
to_date(from_unixtime(cast(cont.createTime as int))) as `date`
from ods.im_session_content a LATERAL VIEW explode(content) bb AS cont
where from_unixtime(cast(cont.createTime as int)) < '2018-11-25'
;

INSERT overwrite table ods.im_session_content_record partition(`date`)
select
-999 as source_type,
a.cid,
a.sid,
a.vccid,
a.userid,
current_timestamp as bi_update_datetime,
to_date(from_unixtime(cast(cont.createTime as int))) as `date`
from ods.im_session_content a LATERAL VIEW explode(content) bb AS cont
where from_unixtime(cast(cont.createTime as int)) >= '2018-11-25'
and from_unixtime(cast(cont.createTime as int)) < '2018-12-02'
;

我的博客即将同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=3ckgexxns8g0o

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值