github-actions[bot] commented on code in PR #65546:
URL: https://github.com/apache/doris/pull/65546#discussion_r3588206507


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/hint/LeadingHint.java:
##########
@@ -416,20 +416,13 @@ public Pair<JoinConstraint, Boolean> 
getJoinConstraint(Long joinTableBitmap, Lon
                 continue;
             }
 
-            if (joinConstraint.getJoinType().isSemiOrAntiJoin()) {
-                if (!LongBitmap.isSubset(joinConstraint.getMinLeftHand(), 
joinTableBitmap)
-                        || 
!LongBitmap.isSubset(joinConstraint.getMinRightHand(), joinTableBitmap)) {
+            if (joinConstraint.getJoinType().isSemiJoin()) {

Review Comment:
   This restores the old constrained-side bug for leading hints. For semi/anti 
joins the full non-retained side has to remain wholly on one child before the 
constraint can match, but this block now only runs for `isSemiJoin()`, the 
first predicate is impossible (`isSubset(rightHand, leftTableBitmap) && 
!isSubset(rightHand, leftTableBitmap)`), and right semi joins still check 
`rightHand` even though their constrained side is `leftHand`.
   
   For example, with a left-semi constraint `minLeft=A`, `minRight=B`, 
`leftHand=A`, `rightHand=B|C`, a leading split `left=A|C, right=B` skips this 
guard and then matches lines 430-436 because the min hands are present, 
producing `(A join C) LEFT_SEMI B` even though `C` belonged to the constrained 
right side. Left anti follows the same path because anti joins no longer enter 
the guard at all. The deleted `LeadingHintTest` had direct cases for these 
semi/anti constrained-side splits, so this PR reintroduces the bad match and 
removes the coverage that would catch it.



-- 
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