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

posted @ 2017-06-29 20:31  HarkLee  阅读(1097)  评论(0编辑  收藏  举报