Impala AnalysisException: HAVING 子句不支持子查询
Impala AnalysisException: Subqueries are not supported in the HAVING clause
我有一个查询,我在其中选择用户代理字符串匹配的目标主机名,并使用 Impala.
根据存在不同 srchostname 的位置进行分组
select desthostname
from proxy_table
where useragentstring = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/538.1 (KHTML, like Gecko) Google Earth Pro/7.3.2.5491 Safari/538.1"
group by desthostname
having count(*) = (select count(distinct srchostname) from proxy_table);
但我运行陷入了错误:
AnalysisException: Subqueries are not supported in the HAVING clause.
你知道我该如何解决这个问题吗?
运行这个:
select desthostname from
(select desthostname,count(*) as cnt
from proxy_table
where useragentstring = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/538.1 (KHTML, like Gecko) Google Earth Pro/7.3.2.5491 Safari/538.1"
group by desthostname) A where A.cnt in (select count(distinct srchostname) from proxy_table);
我有一个查询,我在其中选择用户代理字符串匹配的目标主机名,并使用 Impala.
根据存在不同 srchostname 的位置进行分组select desthostname
from proxy_table
where useragentstring = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/538.1 (KHTML, like Gecko) Google Earth Pro/7.3.2.5491 Safari/538.1"
group by desthostname
having count(*) = (select count(distinct srchostname) from proxy_table);
但我运行陷入了错误:
AnalysisException: Subqueries are not supported in the HAVING clause.
你知道我该如何解决这个问题吗?
运行这个:
select desthostname from
(select desthostname,count(*) as cnt
from proxy_table
where useragentstring = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/538.1 (KHTML, like Gecko) Google Earth Pro/7.3.2.5491 Safari/538.1"
group by desthostname) A where A.cnt in (select count(distinct srchostname) from proxy_table);