xzj7019 commented on code in PR #21883:
URL: https://github.com/apache/doris/pull/21883#discussion_r1270331504


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java:
##########
@@ -147,6 +144,16 @@ public PhysicalPlan 
visitPhysicalHashJoin(PhysicalHashJoin<? extends Plan, ? ext
     public PhysicalCTEConsumer visitPhysicalCTEConsumer(PhysicalCTEConsumer 
scan, CascadesContext context) {
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
         scan.getOutput().forEach(slot -> ctx.getAliasTransferMap().put(slot, 
Pair.of(scan, slot)));
+        Set<CTEId> processedCTE = 
context.getRuntimeFilterContext().getProcessedCTE();
+        CTEId cteId = scan.getCteId();
+        if (!processedCTE.contains(cteId)) {
+            PhysicalCTEProducer cteProducer = context.getRuntimeFilterContext()
+                    .getCteProduceMap().get(cteId);
+            PhysicalPlan inputPlanNode = (PhysicalPlan) cteProducer.child(0);
+            // handle cte internal
+            inputPlanNode.accept(this, context);
+            processedCTE.add(cteId);
+        }

Review Comment:
   done



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java:
##########
@@ -157,15 +159,25 @@ public void createLegacyRuntimeFilter(RuntimeFilter 
filter, JoinNodeBase node, P
                 //bitmap rf requires isBroadCast=false, it always requires 
merge filter
                 origFilter.setIsBroadcast(false);
             }
-            boolean isLocalTarget = scanNodeList.stream().allMatch(e -> 
e.getFragmentId().equals(node.getFragmentId()));
+            boolean isLocalTarget = scanNodeList.stream().allMatch(e ->
+                    e.getStatisticalType() != StatisticalType.CTE_SCAN_NODE

Review Comment:
   done



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to