hive建表、Partition key設置、insert

drop table if exists ccs_table;
create table if not exists ccs_table
(id string comment '客戶號‘,
data_date string comment '數據日期’)
partitioned by (data_dt string);

插入內容到 ccs_table
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.optimize.index.filter=false;
set tez.quence.name=api_ccs;

insert overwrite table ccs_table partition (data_dt =‘2020-06-02’)
select id,‘2020-06-02’ as data_date
from ccs_bdp_table_b(把內容存儲爲一個臨時表,檢查完畢後插入到上述ccs_table正式表)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章