Hive Union ALL - java nullpointer异常

时间:2016-03-25 19:25:20

标签: nullpointerexception hive union-all

我有一个Hive查询,就像这样

Ask

以上查询工作正常。 当我将查询更改为以下内容时:

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

我得到java Null-pointer错误。所以我假设最后一个查询有问题。 然后我试试这个

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

它有效。 问题是Union所有查询都失败了,但查询本身就有效。 关于如何在Union All中使用它的任何指示?

1 个答案:

答案 0 :(得分:1)

试试这个。

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