我正在使用sparksql创建一个查询。实际查询的大小有点大,但我遇到的问题是以下错误 Error in SQL statement: AnalysisException: IN/EXISTS predicate sub-queries can only be used in a Filter: Aggregate
下面的查询部分导致了问题。我不确定
select col1, col2,
sum(case
WHEN snoozed_until is NULL
AND hired is NULL
AND lower(profile_archive_status) = 'true'
AND profile_id NOT IN
(SELECT profile_id
FROM candidates_feedback f
WHERE lower(f.a1) LIKE '%no%') THEN
1
ELSE 0 END) Archived,
sum(case
WHEN snoozed_until is NULL
AND hired is NULL
AND lower(profile_archive_status) = 'true'
AND profile_id IN (SELECT profile_id FROM candidates_feedback f WHERE lower(f.a1) LIKE '%no%') THEN 1 ELSE 0 END) Rejected,
from table;
1条答案
按热度按时间e1xvtsh31#
对子查询使用左联接: