github-actions[bot] commented on code in PR #65919:
URL: https://github.com/apache/doris/pull/65919#discussion_r3630953378


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java:
##########
@@ -388,6 +381,22 @@ private org.apache.doris.planner.RuntimeFilter 
finalize(org.apache.doris.planner
         return origFilter;
     }
 
+    private void 
setPartitionPruningMetadata(org.apache.doris.planner.RuntimeFilter 
runtimeFilter,
+            ScanNode scanNode, 
RuntimeFilterPartitionPruneClassifier.Classification classification) {
+        if (classification.canPrunePartitions()) {
+            Preconditions.checkState(scanNode instanceof OlapScanNode,
+                    "partition-pruning runtime filter target must be an 
OlapScanNode");
+            runtimeFilter.markTargetCanPrunePartitions(scanNode.getId());
+            ConnectContext rfPruneCtx = ConnectContext.get();
+            if (rfPruneCtx != null

Review Comment:
   `enable_runtime_filter_partition_prune` is not stable across these two 
checks. The workload-policy thread can call `WorkloadActionSetSessionVar` on a 
live query's `SessionVariable`; if this flag is false here, the target is still 
marked as partition-prunable but no snapshot is stored. If the policy flips it 
to true while the query waits in the workload queue, `OlapScanNode.toThrift()` 
re-reads true, sees the marked RF, and calls 
`setPartitionBoundariesForRuntimeFilter()`, which now fails because the 
snapshot is null. (Before this change, that serialization-time path built the 
boundaries instead.) Please capture one immutable per-plan enablement decision, 
or snapshot every marked target regardless of the later-mutable flag, and cover 
the false-to-true transition through the real translator/`toThrift()` path in a 
test.



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