码迷,mamicode.com
首页 > 其他好文 > 详细

SemanticException Column xx Found in more than One Tables/Subqueries

时间:2015-07-02 01:20:17      阅读:1507      评论:0      收藏:0      [点我收藏+]

标签:hive semanticexception   more than one tables/subqueries

执行hiveql时报错:

SemanticException Column xx Found in more than One Tables/Subqueries

Hive中有两张表中拥有同一个字段名称,在这两个表做关联的时候会报这个错误

技术分享







将其中一个表的重复字段加上别名,然后进行关联查询

select city.city, hotel.hotel, hotel.hotelname from city city, 

(select city as hcity  ,hotel , hotelname from hotel) hotel

where city.city = hotel.hcity


SemanticException Column xx Found in more than One Tables/Subqueries

标签:hive semanticexception   more than one tables/subqueries

原文地址:http://10120275.blog.51cto.com/10110275/1669859

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!