在Hive中获取语法错误以查询以使用左外连接创建表

时间:2016-09-18 21:51:50

标签: mysql hiveql

create table db_db.result_av1 as
(select distinct user_name 
 from            movies.user_activity a
 left outer join (select  activity_count as result
                  from    movies.user_activity
                  where   user_activity like "%gz%")
) d
(on a.user_name=d.user_name)
where a.date between '2015-05-10' and '2015-08-04'
and   substr(user_name,1,24) is Not null
limit 5;

收到错误

  编译语句时出现

错误:失败:
  parseexception 9:0在'''''''附近缺少eof

1 个答案:

答案 0 :(得分:0)

你的括号不对。试试这个:

create table db_db.result_av1 as
 select distinct user_name 
 from            movies.user_activity a
 left outer join (select  activity_count as result
                  from    movies.user_activity
                  where   user_activity like "%gz%") d
              on a.user_name=d.user_name
 where a.date between '2015-05-10' and '2015-08-04'
 and   substr(user_name,1,24) is Not null
 limit 5;