我正在运行一个查询,该查询提供了一组不重叠的first_party_id - 这些ID与一个第三方相关联,但与另一个第三方无关。然而,在Athena中运行此查询会出现错误:Correlated queries not yet supported.
查看了prestodb文档,https://prestodb.io/docs/current/sql/select.html(Athena在底层使用prestodb),寻找嵌套查询的替代方案。文档中给出的with语句
示例似乎不适用于not in
子句。想知道嵌套查询的替代方案是什么 - 查询如下。
SELECT
COUNT(DISTINCT i.third_party_id) AS uniques
FROM
db.ids i
WHERE
i.third_party_type = 'cookie_1'
AND i.first_party_id NOT IN (
SELECT
i.first_party_id
WHERE
i.third_party_id = 'cookie_2'
)
with x as ( with y as (...), z as (...) ....)
- pauld