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


##########
be/src/exec/scan/scanner.cpp:
##########
@@ -253,9 +260,58 @@ Status Scanner::try_append_late_arrival_runtime_filter() {

Review Comment:
   `_conjuncts` is cleared before we know `clone_conjunct_ctxs()` succeeded. 
Today the scheduler only logs `try_append_late_arrival_runtime_filter()` 
failures and keeps scanning, so any clone error here leaves this scanner with 
an empty `_conjuncts` vector and `_filter_output_block()` stops applying even 
the original SQL predicates. Please clone into a temporary vector and only swap 
on success, or propagate the failure so the query stops instead of silently 
returning unfiltered rows.



##########
be/src/exec/scan/scanner.cpp:
##########
@@ -253,9 +260,58 @@ Status Scanner::try_append_late_arrival_runtime_filter() {
     // avoid conjunct destroy in used by storage layer
     _conjuncts.clear();
     RETURN_IF_ERROR(_local_state->clone_conjunct_ctxs(_conjuncts));
+    if (_late_rf_container != nullptr) {
+        std::lock_guard<std::mutex> lock(_late_rf_container->mutex);
+        _late_rf_container->zone_map_expr_ctxs.clear();
+        for (const auto& conjunct : _conjuncts) {
+            if (_is_zone_map_eligible_expr(conjunct->root().get())) {
+                _late_rf_container->zone_map_expr_ctxs.push_back(conjunct);
+            }
+        }
+        ++_late_rf_container->version;

Review Comment:
   `_applied_rf_num` is advanced before 
`_on_late_arrival_runtime_filter_appended()` succeeds. If the refresh hook 
fails, the scheduler logs the error and continues, but the next poll now sees 
`arrived_rf_num == _applied_rf_num` and never retries this late filter. That 
leaves the reader/storage refresh permanently stale for the rest of the scan. 
Please move the counter update after the append hook succeeds.



##########
be/src/format/parquet/vparquet_reader.cpp:
##########
@@ -521,6 +525,13 @@ Status ParquetReader::_do_init_reader(ReaderInitContext* 
base_ctx) {
     return Status::OK();
 }
 

Review Comment:
   This only updates `_lazy_read_ctx.conjuncts`, but the active 
`RowGroupReader` already copied its `_filter_conjuncts` when it was 
initialized. If a late runtime filter arrives while the current row group still 
has unread rows, the current Parquet reader keeps using the old predicate set 
and misses the new pruning path for that row group. ORC rebuilds and seeks the 
active reader in its refresh hook; Parquet needs an equivalent refresh here (or 
some other way to make the current `RowGroupReader` observe the new conjuncts).



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