morrySnow commented on code in PR #65837:
URL: https://github.com/apache/doris/pull/65837#discussion_r3780563333
##########
fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilter.java:
##########
@@ -391,6 +392,14 @@ public TRuntimeFilterDesc toThrift() {
}
}
+ boolean enableRfBucketPrune = rfPruneCtx != null
+ &&
rfPruneCtx.getSessionVariable().isEnableRuntimeFilterBucketPrune();
Review Comment:
这里也没必要判断,应当在translator里面统一完成判断
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java:
##########
@@ -393,6 +395,18 @@ private void
setPartitionPruningMetadata(org.apache.doris.planner.RuntimeFilter
scanNode.getId(), classification.getPartitionMonotonicity());
}
+ private void
setBucketPruningMetadata(org.apache.doris.planner.RuntimeFilter runtimeFilter,
Review Comment:
bucket 和 partition prunning 的生成可以迁移到 nereids 的runtime filter生成处吗?按照设计
translator不应承担此任务
##########
fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java:
##########
@@ -1420,6 +1423,43 @@ void
setPartitionBoundariesForRuntimeFilter(TOlapScanNode olapScanNode) {
}
}
+ private boolean hasRfDrivingBucketPruning() {
+ PlanNodeId myId = this.getId();
+ for (RuntimeFilter rf : runtimeFilters) {
+ if (rf.canPruneBucketsFor(myId)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void setRuntimeFilterBucketPruneParameters() {
+ if (!hasRfDrivingBucketPruning()) {
+ return;
+ }
+ for (TScanRangeLocations locations : scanRangeLocations) {
+ TPaloScanRange scanRange =
locations.getScanRange().getPaloScanRange();
+ Long bucketInfo = tabletId2BucketInfo.get(scanRange.getTabletId());
+ Preconditions.checkState(bucketInfo != null &&
decodeBucketNum(bucketInfo) > 0,
+ "missing bucket metadata for runtime-filter bucket
pruning, tablet=%s",
+ scanRange.getTabletId());
Review Comment:
这里不要check吧,有问题的话直接跳过去,打印一个 warning日志。注入debug点后再显式失败。
##########
fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java:
##########
@@ -1420,6 +1423,43 @@ void
setPartitionBoundariesForRuntimeFilter(TOlapScanNode olapScanNode) {
}
}
+ private boolean hasRfDrivingBucketPruning() {
+ PlanNodeId myId = this.getId();
+ for (RuntimeFilter rf : runtimeFilters) {
+ if (rf.canPruneBucketsFor(myId)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void setRuntimeFilterBucketPruneParameters() {
Review Comment:
为什么要额外放置在ThriftOPlansBuilder里,而不是在scannode的toThrift时候直接调用?
##########
fe/fe-core/src/main/java/org/apache/doris/qe/runtime/ThriftPlansBuilder.java:
##########
@@ -205,6 +208,19 @@ static void setRuntimePredicateIfNeed(Collection<ScanNode>
scanNodes) {
}
}
+ static void setRuntimeFilterBucketPruneParametersIfNeeded(
+ Collection<ScanNode> scanNodes, ConnectContext connectContext) {
+ if (connectContext == null
+ ||
!connectContext.getSessionVariable().isEnableRuntimeFilterBucketPrune()) {
+ return;
Review Comment:
应在再开始的生成处统一判断 session variable。而不是每个地方都判断一下
--
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]