starocean999 commented on code in PR #8745:
URL: https://github.com/apache/incubator-doris/pull/8745#discussion_r844833976


##########
fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java:
##########
@@ -122,6 +124,33 @@ private RuntimeFilterGenerator(Analyzer analyzer) {
         bloomFilterSizeLimits = new FilterSizeLimits(sessionVariable);
     }
 
+    private void collectAllTupleIdsHavingConjunct(PlanNode node, 
HashSet<TupleId> tupleIds) {
+        // for simplicity, skip join node( which contains more than 1 tuple id 
)
+        // we only look for the node meets either of the 2 conditions:
+        // 1. The node itself has conjunct
+        // 2. it's an aggregation or exchange node with no conjunct, but its 
descendant have conjuncts.
+        int tupleNumBeforeCheckingChildren = tupleIds.size();
+        for (PlanNode child : node.getChildren()) {
+            collectAllTupleIdsHavingConjunct(child, tupleIds);
+        }
+        if ((node.getTupleIds().size() == 1 && !node.conjuncts.isEmpty())) {
+            // The node itself has conjunct
+            tupleIds.add(node.getTupleIds().get(0));
+        } else if ((node instanceof AggregationNode || node instanceof 
ExchangeNode) && tupleIds.size() > tupleNumBeforeCheckingChildren) {

Review Comment:
   Yes I agree. This is not a perfect solution to only check agg and exchange 
node's children' conjunct. I added this code because after testing all tpch 22 
queries, I found one useful runtime filter of q2 was removed. The goal of this 
modification is trying to keep all possible useful runtime filters and remove 
ones which are absolutely useless. ( that means we might still have some 
invalid ones in some cases ). For other node types, I am not so sure if this 
logic is still valid. So I think we can add more node types here if we come 
across new scenarios in future.
   



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