Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
ghx-label-10
Description
A simple case of IMPALA-5226 with a simple rewrite is an IN predicate. We can directly rewrite it into a left outer join
WHERE <condition> OR (x IN (select y ...))
Can be transformed into
LEFT OUTER JOIN (select distinct y ...) v on x = v.y ... WHERE <condition> OR v.y IS NOT NULL
This pattern appears in TPC-DS query 45.