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'
;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM