当前位置: 首页 > 知识库问答 >
问题:

从原始外部表到动态分区外部表的配置单元插入覆盖失败,

丌官瀚
2023-03-14

插入覆盖失败,出现空指针异常-

insert overwrite  table  external_partitioned partition(country_destination,gender) <br>
select (age_bucket,population_in_thousandsyear,country_destination,gender) <br>
from external_partitioned_rawtable;

失败:NullPointerException为空

共有1个答案

吕永寿
2023-03-14

对于动态分区插入,在执行insert语句之前,必须执行配置单元的两个属性:

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

然后执行insert语句(我已修改)

insert overwrite  table  external_partitioned partition(country_destination,gender) 
select age_bucket,population_in_thousandsyear,country_destination,gender 
from external_partitioned_rawtable;

希望这对你有帮助!!!

 类似资料: