2016-03-25 19 views
0

Ich habe eine Hive Abfrage, die so etwas wie dieseHive Union ALL - java Nullpointer Ausnahme

insert into table all_data 
    select a,b from t1 
    union all 
    select a,b from t2` 

Die obige Abfrage funktioniert gut ist. Wenn ich meine Abfrage folgt ändern:

insert into table all_data 
    select a,b from t1 
    union all 
    select a,b from t2 
    union all 
    select a,b from t3 

I java Null-Zeiger-Fehler erhalten. SO nehme ich an, dass die letzte Abfrage ein Problem hat. Dann versuche ich diese

insert into table all_data 
    select a,b from t3 

Und es funktioniert. Das Problem ist Union Die gesamte Abfrage schlägt fehl, aber die Abfrage funktioniert allein. Irgendwelche Hinweise, wie es in Union All funktioniert?

Antwort

0

versuchen Sie dies.

insert into table all_data 
select * from (
select a,b from t1 
union all 
select a,b from t2 
union all 
select a,b from t3 
) u