4

私は4つの列を持つ生の外部テーブルを持っています - テーブル1:

外部
テーブル

作成

Country_destinationとgender.Table -2のパーティションを持つ外部テーブルが必要です

外部テーブルを作成する external_partitioned
(age_bucket String,population_in_thousandsyear int)
によってパーティション化される (country_destination String,gender String)
行形式で区切られたフィールド '\t'
行で終了 '\n' で終了

挿入の上書きが null ポインター例外で失敗する -

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

4

1 に答える 1

2

動的パーティション挿入の場合、INSERTステートメントを実行する前に、ハイブの 2 つのプロパティを実行する必要があります。

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;

これがお役に立てば幸いです!!!

于 2016-06-01T07:06:08.183 に答える