Copilot commented on code in PR #63781:
URL: https://github.com/apache/doris/pull/63781#discussion_r3315205172


##########
be/src/exec/scan/scanner.cpp:
##########
@@ -286,7 +286,9 @@ void Scanner::_collect_profile_before_close() {
     COUNTER_UPDATE(_local_state->_scan_cpu_timer, _scan_cpu_timer);
     COUNTER_UPDATE(_local_state->_rows_read_counter, _num_rows_read);
 
-    // Update stats for load
+    if (!_is_load) return;
+    // Only load scanners can contribute to load quality counters. Query-side
+    // predicate filtering must not be mixed into insert/delete load stats.
     _state->update_num_rows_load_filtered(_counter.num_rows_filtered);
     _state->update_num_rows_load_unselected(_counter.num_rows_unselected);

Review Comment:
   This behavior change fixes a regression-prone accounting bug in load quality 
counters (DELETE/INSERT with subquery scans when `enable_profile` is on), but 
this PR doesn’t add/adjust a regression test to lock the scenario in. Consider 
adding a regression test that enables profile and runs a DELETE with a subquery 
scan that applies scan predicates, asserting it no longer fails with 
filtered-row ratio errors (and/or that load counters stay non-negative).
   



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