[fix](Nereids): fix wrong case in TransposeSemiJoinLogicalJoinProject (#30874)

This commit is contained in:
jakevin
2024-02-06 11:18:21 +08:00
committed by yiguolei
parent 8d4e0c50c6
commit 2e4daa7006

View File

@ -76,7 +76,11 @@ public class TransposeSemiJoinLogicalJoinProject extends OneRewriteRuleFactory {
* A B A C
*/
// RIGHT_OUTER_JOIN should be eliminated in rewrite phase
Preconditions.checkState(bottomJoin.getJoinType() != JoinType.RIGHT_OUTER_JOIN);
// TODO: when top join is ANTI JOIN, bottomJoin may be RIGHT_OUTER_JOIN
// Can we also do the transformation?
if (bottomJoin.getJoinType() == JoinType.RIGHT_OUTER_JOIN) {
return null;
}
Plan newBottomSemiJoin = topSemiJoin.withChildren(a, c);
Plan newTopJoin = bottomJoin.withChildren(newBottomSemiJoin, b);
@ -92,7 +96,11 @@ public class TransposeSemiJoinLogicalJoinProject extends OneRewriteRuleFactory {
* A B B C
*/
// LEFT_OUTER_JOIN should be eliminated in rewrite phase
Preconditions.checkState(bottomJoin.getJoinType() != JoinType.LEFT_OUTER_JOIN);
// TODO: when top join is ANTI JOIN, bottomJoin may be RIGHT_OUTER_JOIN
// Can we also do the transformation?
if (bottomJoin.getJoinType() == JoinType.LEFT_OUTER_JOIN) {
return null;
}
Plan newBottomSemiJoin = topSemiJoin.withChildren(b, c);
Plan newTopJoin = bottomJoin.withChildren(a, newBottomSemiJoin);