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


##########
be/src/exec/operator/scan_operator.cpp:
##########
@@ -82,6 +83,14 @@ Status 
ScanLocalStateBase::update_late_arrival_runtime_filter(RuntimeState* stat
             return a->execute_cost() < b->execute_cost();
         });
     };
+    if (_scan_filter_profile != nullptr) {
+        for (size_t i = conjuncts_before; i < _conjuncts.size(); ++i) {
+            if (_conjuncts[i]->root() != nullptr && 
!_conjuncts[i]->scan_filter_handle()) {
+                _conjuncts[i]->attach_scan_filter(
+                        _register_scan_filter(_conjuncts[i]->root(), nullptr));
+            }

Review Comment:
   This loop no longer necessarily visits the runtime filters appended by 
`try_append_late_arrival_runtime_filter()`. `conjuncts_before` is captured 
before append, but then `enable_adjust_conjunct_order_by_cost()` sorts the 
whole `_conjuncts` vector before this index-based registration. If a newly 
arrived RF has lower `execute_cost()` than an existing conjunct, it can move 
before `conjuncts_before`; the loop will only inspect old tail entries, so the 
new RF is cloned into scanners without a `ScanFilterHandle`. The legacy RF 
counters may still appear through `collect_scan_filter_profile()`, but the new 
profile will show that RF as `NotApplied` and will miss its `EXEC_RESIDUAL` 
stage rows. Please attach handles to the newly appended contexts before 
sorting, or keep explicit pointers/iterators to the appended contexts and 
register those after sorting.



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