Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
ghx-label-5
Description
Given the following query:
SELECT * FROM functional.alltypes WHERE NOT (id < 10 AND (int_col IN (SELECT int_col FROM functional.alltypestiny)) AND (string_col = (SELECT max(string_col) FROM functional.alltypestiny)))
We get the following error message:
ERROR: AnalysisException: Subqueries in OR predicates are not supported: id >= 10 OR int_col NOT IN (SELECT int_col FROM functional.alltypestiny) OR string_col != (SELECT max(string_col) FROM functional.alltypestiny)
Which is strange, because we only have AND predicates in our statement.
When Impala rewrites the query it applies De Morgan's laws, so it pushes the NOT predicate into the conditions and turns the AND predicates to ORs. And that's invalidates our query statement, because subqueries in OR predicates are not allowed.
Attachments
Issue Links
- relates to
-
IMPALA-5226 Add support for arbitrary subqueries in WHERE/HAVING, including inside disjuncts
- Open