在 Hive 中获取语法错误以使用左外连接创建 table 的查询
Getting syntactical error in Hive for query to create table using left outer join
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;
获取错误
error while compiling statement: failed:
parseexception line 9:0 missing eof at '(' near 'd'
你的括号没放对。试试这个:
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;
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;
获取错误
error while compiling statement: failed:
parseexception line 9:0 missing eof at '(' near 'd'
你的括号没放对。试试这个:
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;