hive 动态分区插入

首先需要进行以下设置:

set hive.exec.dynamic.partition=true;  

set hive.exec.dynamic.partition.mode=nonstrict;  

set hive.exec.max.dynamic.partitions.pernode=10000;

 

 

动态插入语法 :

insert overwrite table tb_test (biz_date)

select col_a,

col_b,

.....

col_last,

col_date  --这个字段不是实际插入到表中的哦,只是用来标识根据此字段的值来插入到不同的分区中

from tb_test0

 

原文地址:https://www.cnblogs.com/qiuhong10/p/7827673.html