[Fix](nereids) fix leading with left join without leftside condition (#31387)

When left join with no edge in outer side, we should add outer side to minimal require of left tables


Co-authored-by: libinfeng <libinfeng@selectdb.com>
This commit is contained in:
LiBinfeng
2024-03-01 16:00:48 +08:00
committed by yiguolei
parent 4888b4405b
commit 535e3b23ea
3 changed files with 318 additions and 4 deletions

View File

@ -162,6 +162,12 @@ public class CollectJoinConstraint implements RewriteRuleFactory {
}
}
}
if (minLeftHand == 0L) {
minLeftHand = leftHand;
}
if (minRightHand == 0L) {
minRightHand = rightHand;
}
JoinConstraint newJoinConstraint = new JoinConstraint(minLeftHand, minRightHand, leftHand, rightHand,
join.getJoinType(), isStrict);