Repository navigation
[CALCITE-7833] MULTI_JOIN_OPTIMIZE_BUSHY may turn an outer join into an inner join - #5301
Conversation
| sql(sql).withPre(preProgram).withProgram(program).check(); | ||
| } | ||
|
|
||
| @Test void testBushyJoinRuleSkipsFullOuterJoin() { |
There was a problem hiding this comment.
Could you please add a comment referencing the jira above these test cases?
There was a problem hiding this comment.
Added the Jira reference to these test cases.
| } | ||
|
|
||
| if (multiJoinRel.isFullOuterJoin() || multiJoinRel.containsOuter()) { | ||
| // Refuse to apply this rule to a multijoin with outer joins, |
There was a problem hiding this comment.
Does this rule rebuild all joins as INNER joins? If so, could you mention this in the comment?
There was a problem hiding this comment.
Yes. This rule rebuilds all join factors from LoptMultiJoin as INNER joins, so it cannot preserve outer-join semantics.
The issue was frist reported by https://issues.apache.org/jira/browse/CALCITE-5289
a0aaf34 to
2ec69bd
Compare
|
Please squash your commits @ehds |
2ec69bd to
8b53906
Compare
Done. |
8b53906 to
c885d02
Compare
|



Jira Link
CALCITE-7833
Changes Proposed
The previous check relied on outerJoinFactors being non-empty, which misses FULL joins and cases such as
LEFT JOIN ... ON TRUE, where the dependency set is empty.This change checks
isFullOuterJoin()andcontainsOuter()before optimizing.