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


##########
regression-test/suites/query_p0/hint/fix_leading.groovy:
##########
@@ -193,8 +193,9 @@ suite("fix_leading") {
 
     // check left right join result
     qt_select4_1 """select count(*) from t1 left join t2 on c1 > 500 and c2 
>500 right join t3 on c3 > 500 and c1 < 200;"""
-    qt_select4_2 """select /*+ leading(t1 t2 t3)*/ count(*) from t1 left join 
t2 on c1 > 500 and c2 >500 right join t3 on c3 > 500 and c1 < 200;"""
-    qt_select4_3 """explain shape plan select /*+ leading(t1 t2 t3)*/ count(*) 
from t1 left join t2 on c1 > 500 and c2 >500 right join t3 on c3 > 500 and c1 < 
200;"""
+    // TODO: Re-enable after LEADING handles right join constraints without 
Analyzer normalization.

Review Comment:
   [P1] Preserve right-join ON semantics before disabling this test
   
   After normalization is removed from Analyzer, `CollectJoinConstraint` now 
sees this top `RIGHT_OUTER_JOIN` directly. It only pins ON predicates to both 
inputs for `isLeftJoin()`; there is no symmetric right-join case. Consequently 
the preserved-side predicate `c3 > 500` is recorded against `{t3}` alone, and 
`LeadingHint.makeFilterPlanIfExist` can move it below `Scan(t3)`. Rows with `c3 
<= 500` must still survive this right outer join as null-extended rows, but 
that pushed filter drops them. The existing `qt_select4_2` count (`1000`) and 
`qt_select4_3` shape/`Used: leading` assertions cover exactly this behavior, so 
commenting them out only hides the wrong-result regression. Please make LEADING 
encode right-join constraints symmetrically (the same concern applies to 
preserved-side RIGHT ANTI predicates) and keep these assertions enabled.



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