create table as select Join语句在hive中不起作用

时间:2013-11-20 14:24:50

标签: sql hive

使用命令:

hive -e "create table C as 
         (select * from A a 
         left join T t on a.seller_id = t.seller_id 
         where day=31 and month=1 and year=31)"

我收到以下错误:

  

无法识别连接类型说明符

中'left''join''T'附近的输入

2 个答案:

答案 0 :(得分:3)

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SubQueries

  

Hive仅在FROM子句中支持子查询。

也许:

create table C as select * from (select * from A a left join T t on a.seller_id = t.seller_id where day =31 and month = 1 and year = 31 )x"

答案 1 :(得分:1)

它应该留在外部加入