我在雅典娜有当前查询。
SELECT col1,
col_2,
A.col_3
FROM
(SELECT col_1,
col_3
FROM table_1
JOIN col_3
WHERE col_1 IN
(SELECT DISTINCT col_1
FROM table_2
JOIN table_1
ON table_1.col_1 = table_2.col_1
)
) AS A
LEFT JOIN
(SELECT col_2,
col_3
FROM table_3
JOIN col_3
WHERE col_2 IN
(SELECT DISTINCT col_2
FROM table_2
JOIN table_4
ON table_2.col_1 = table_4.col_1
JOIN table_3
ON table_4.col_2 = table_3.col_2
)
) AS B
ON B.col_3 = A.col_3
在SQLite中工作。 但是,当我在AWS Athena中运行它时,出现以下错误:
Queries of this type are not supported (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: some_id)
我假定AWS Athena不支持该查询的某些部分,但是我是Framework的新手。
答案 0 :(得分:2)
“不支持这种类型的查询”是Athena通用的说法,即它不理解您的SQL,但这不是一个简单的语法错误。换句话说,您正在使用Athena不支持的SQL。
单独运行查询的最内部,如果未收到错误,请添加包装该查询的SQL,依此类推,直到找到导致错误的片段。如果您不知道如何解决,请提出一个新的问题。