我有一个四列的原始外部表 -
表格1 :



我想要一个带有 Country_destination 和性别分区的外部表。表 -2



插入覆盖因空指针异常而失败-

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 null

最佳答案

对于动态分区插入,在执行 INSERT 语句之前,你必须执行 hive 的两个属性:

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

然后执行插入语句(我已修改)
insert overwrite  table  external_partitioned partition(country_destination,gender)
select age_bucket,population_in_thousandsyear,country_destination,gender
from external_partitioned_rawtable;

我希望这对你有帮助!!!

关于hadoop - 从原始外部表向动态分区外部表中的 Hive 插入覆盖失败,出现空指针异常。,,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37560774/

10-11 21:33