Hive 配置单元列作为子查询选择
我正试着用蜂箱做下面的事情。如何将配置单元中的列定义为子查询?这在蜂巢里可能吗Hive 配置单元列作为子查询选择,hive,Hive,我正试着用蜂箱做下面的事情。如何将配置单元中的列定义为子查询?这在蜂巢里可能吗 hive -e " select distinct i.SearchListingID, (select count(*) from calls c where c.ServiceID = i.SearchListingID ) as CallsCount from Impressions i where i.yyyymmdd = 20120401 limit 10"
hive -e "
select
distinct i.SearchListingID,
(select count(*)
from calls c
where c.ServiceID = i.SearchListingID
) as CallsCount
from Impressions i
where i.yyyymmdd = 20120401
limit 10" > ImpressionCalls.txt
Hive history file=/tmp/jd/hive_job_log_jd_201205222049_550931420.txt
失败:分析错误:第4:1行无法识别表达式规范中“选择”“计数”()附近的输入
配置单元中不支持相关子查询。 这样怎么样?(我自己没有机会在Hive上验证这个查询)
配置单元中不支持相关子查询。 这样怎么样?(我自己没有机会在Hive上验证这个查询)
谢谢!你让我走上了正确的轨道。我必须添加一个“group by I.SearchListingID”子句才能使其工作。谢谢!你让我走上了正确的轨道。我必须添加一个“group by I.SearchListingID”子句才能使其工作。
select
i.SearchListingID,
count(*)
from
(
select
distinct i.SearchListingID as SearchListingID
from
Impressions i
where
i.yyyymmdd = 20120401
)i
join
calls c
on(c.ServiceID = i.SearchListingID)
limit 10