xinyiZzz commented on code in PR #8745:
URL: https://github.com/apache/incubator-doris/pull/8745#discussion_r845709112
##########
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:
If don't need to limit the node type, this strategy can be placed after the
entire runtime filter is generated, and you only need to traverse
`runtimeFiltersByTid`.
--
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]