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


##########
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:
   I think there is no need to limit node types, including join nodes, which 
will make this pr less tricky and easier to understand and use.
   
   You can try to remove `node.getTupleIds().size() == 1` and `node instanceof 
AggregationNode || node instanceof ExchangeNode`, and then test it on SSB and 
TPCH
   
   In addition to agg and exchange nodes, the nodes that satisfy the number of 
tuples equal to 1 and the children have conjunct are mainly: sort, union, topn, 
table function, it seems that they can be generated.



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