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


##########
be/src/format_v2/table_reader.h:
##########
@@ -213,6 +218,7 @@ class TableReader {
             size_t current_rows = 0;
             
RETURN_IF_ERROR(_data_reader.reader->get_block(&_data_reader.block_template,
                                                            &current_rows, 
&current_eof));
+            _sync_reader_read_rows_to_io_context();

Review Comment:
   This sync point is skipped when aggregate pushdown succeeds. `get_block()` 
calls `_try_materialize_aggregate_pushdown_rows()` above this and returns 
immediately when `pushed_down` is true; that path calls 
`get_aggregate_result()`, materializes the result rows, and then 
`close_current_reader()` resets the reader. For CSV/TEXT COUNT pushdown, 
`DelimitedTextReader::get_aggregate_result()` actually scans the lines and 
increments its private `_reader_statistics.read_rows`, but nothing copies that 
delta into `_io_ctx->file_reader_stats` before the reader is closed. Since 
`FileScannerV2::update_realtime_counters()` now derives `ScanRows`, IOContext 
scan rows, and `query_scan_rows` from the shared stats, a COUNT-pushed scan can 
read/count rows while publishing zero scan rows. Please sync reader stats 
before closing the aggregate-pushdown reader, or publish the aggregate reader's 
row count to the shared stats explicitly, and cover this path with 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