Affects Version/s: None
Fix Version/s: 0.9.0-incubating
PushFilterPashJoinRule can already convert a filter on a join into a join. (For example, 'FROM emp JOIN dept ON TRUE WHERE emp.deptno = emp.deptno' into 'FROM emp JOIN dept ON emp.deptno = dept.deptno'.)
But if the filter is strong – i.e. it is guaranteed to return false if one of its input values is NULL – then we can upgrade the join type. For example,
The condition is strong on emp.age, and emp.age comes from the left, so that if a null row is generated on the left the condition will fail. Therefore we can strengthen the join type to LEFT, which only generates nulls on the right.
I also want to work on the kind of queries produced by EXISTS/IN rewrite; for example, the query in RelOptRulesTest.testSemiJoinRule