hive中使用union出现异常数据

select * from tbl where id=2

union 

select * from tbl where id =1

如果hive使用union这么查询的时候,我们会发现数据变乱了。

解决办法就是在select后边实际写上列名,就没有问题了,例如:

select column1,column2 from tbl where id=2

union 

select column1,column2 from tbl where id =1

原文地址:https://www.cnblogs.com/hark0623/p/7096277.html