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


##########
be/src/format_v2/json/json_reader.cpp:
##########
@@ -540,8 +541,17 @@ Status JsonReader::_open_file_reader(bool need_schema) {
                 _reader_range.__isset.modification_time ? 
_reader_range.modification_time : 0;
         auto reader_options = 
FileFactory::get_reader_options(_runtime_state->query_options(),
                                                               
*_file_description);
-        auto file_reader = DORIS_TRY(FileFactory::create_file_reader(
-                *_system_properties, *_file_description, reader_options, 
_profile));
+        // The aligned prefix belongs to this scan, while the original split 
end bounds
+        // asynchronous read-ahead. Shared ownership keeps cancellation state 
alive for workers.
+        const auto range_end =
+                _reader_range.size > 0
+                        ? static_cast<size_t>(_reader_range.start_offset + 
_reader_range.size)
+                        : std::numeric_limits<size_t>::max();
+        auto file_reader = DORIS_TRY(io::DelegateReader::create_file_reader(

Review Comment:
   [P3] Publish JSON prefetch counters before releasing the reader
   
   For an S3 JSON/JSON-lines scan with file cache disabled, this sequential 
wrapper accumulates `PreRequestIO`, `PreRequestBytes`, `ReadTime` and 
`CopyTime` in `PrefetchBuffer::_statis`. `JsonReader::close()` only resets its 
reader aliases, and the prefetch destructor drains workers without calling 
`collect_profile_before_close()`, so those counters remain zero after a 
completed scan. Drain and collect the filesystem reader before resetting it, as 
`DelimitedTextReader::close()` does, and check published counter values after 
an actual read. This is separate from the earlier prefetch-restoration finding: 
read-ahead is present, but its statistics are lost.



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