englefly commented on code in PR #64102:
URL: https://github.com/apache/doris/pull/64102#discussion_r3354134902


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterPushDownVisitor.java:
##########
@@ -325,15 +328,57 @@ public Boolean 
visitPhysicalNestedLoopJoin(PhysicalNestedLoopJoin<? extends Plan
         boolean pushed = false;
         Plan left = join.left();
         Plan right = join.right();
-        if (left.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())) {
+        if (left.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())
+                && canPushThroughJoinChild(join, true, ctx)) {
             pushed |= left.accept(this, ctx);
         }
-        if (right.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())) {
+        if (right.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())
+                && canPushThroughJoinChild(join, false, ctx)) {
             pushed |= right.accept(this, ctx);
         }
         return pushed;
     }
 
+    private boolean canPushThroughJoinChild(AbstractPhysicalJoin<? extends 
Plan, ? extends Plan> join,
+            boolean leftChild, PushDownContext ctx) {
+        if (join.equals(ctx.builderNode) || 
!isNullGeneratingChild(join.getJoinType(), leftChild)) {
+            return true;
+        }
+        Set<Slot> childOutput = leftChild ? join.left().getOutputSet() : 
join.right().getOutputSet();
+        return isNullPropagatingForSlots(ctx.probeExpr, childOutput);

Review Comment:
   这里不需要判断了. 调用canPushThroughJoinChild 那个 if 已经判断过了



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterPushDownVisitor.java:
##########
@@ -325,15 +328,57 @@ public Boolean 
visitPhysicalNestedLoopJoin(PhysicalNestedLoopJoin<? extends Plan
         boolean pushed = false;
         Plan left = join.left();
         Plan right = join.right();
-        if (left.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())) {
+        if (left.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())
+                && canPushThroughJoinChild(join, true, ctx)) {
             pushed |= left.accept(this, ctx);
         }
-        if (right.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())) {
+        if (right.getOutputSet().containsAll(ctx.probeExpr.getInputSlots())
+                && canPushThroughJoinChild(join, false, ctx)) {
             pushed |= right.accept(this, ctx);
         }
         return pushed;
     }
 
+    private boolean canPushThroughJoinChild(AbstractPhysicalJoin<? extends 
Plan, ? extends Plan> join,
+            boolean leftChild, PushDownContext ctx) {

Review Comment:
   按习惯,这个变量名 改为 isLeftChild 更合适



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