seawinde commented on code in PR #66182:
URL: https://github.com/apache/doris/pull/66182#discussion_r3709203010


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CollectJoinConstraint.java:
##########
@@ -69,25 +77,26 @@ public List<Rule> buildRules() {
                     nonNullableSlotBitMap = 
LongBitmap.or(nonNullableSlotBitMap, nonNullable);
                     Long filterBitMap = calSlotsTableBitMap(leading, 
expression.getInputSlots(), false);
                     totalFilterBitMap = LongBitmap.or(totalFilterBitMap, 
filterBitMap);
-                    if (join.getJoinType().isLeftJoin()) {
+                    if (joinType.isLeftJoin()) {
                         filterBitMap = LongBitmap.or(filterBitMap, rightHand);
                     }
                     leading.getFilters().add(Pair.of(filterBitMap, 
expression));
-                    leading.putConditionJoinType(expression, 
join.getJoinType());
+                    leading.putConditionJoinType(expression, joinType);
                 }
                 expressions = join.getOtherJoinConjuncts();
                 for (Expression expression : expressions) {
                     Long nonNullable = calSlotsTableBitMap(leading, 
expression.getInputSlots(), true);
                     nonNullableSlotBitMap = 
LongBitmap.or(nonNullableSlotBitMap, nonNullable);
                     Long filterBitMap = calSlotsTableBitMap(leading, 
expression.getInputSlots(), false);
                     totalFilterBitMap = LongBitmap.or(totalFilterBitMap, 
filterBitMap);
-                    if (join.getJoinType().isLeftJoin()) {
+                    if (joinType.isLeftJoin()) {

Review Comment:
   Thanks for identifying this case. This is a pre-existing limitation of the 
current LEADING condition-ownership model rather than an issue introduced by 
moving SemiJoinCommute to the rewrite phase. The existing fixture does not 
expose the wrong result because the c1/c3 values do not exceed 500, although 
the shape reveals that the parent ON conjunct can be consumed by the nested 
outer join. This broader JOIN-boundary tracking will be addressed by the 
follow-up LEADING refactor PR together with a focused result witness. We will 
keep it out of this PR to avoid expanding the scope of the SemiJoinCommute 
stage change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to