SteNicholas commented on code in PR #420:
URL: https://github.com/apache/paimon-cpp/pull/420#discussion_r4227457181


##########
src/paimon/common/reader/concat_batch_reader.cpp:
##########
@@ -34,7 +36,12 @@ 
ConcatBatchReader::ConcatBatchReader(std::vector<std::unique_ptr<BatchReader>>&&
     : arrow_pool_(arrow_pool),
       finished_reader_metrics_(std::make_shared<MetricsImpl>()),
       readers_(std::move(readers)),
-      current_(0) {}
+      current_(0) {
+    file_readers_.reserve(readers_.size());
+    for (const auto& reader : readers_) {
+        file_readers_.push_back(dynamic_cast<FileBatchReader*>(reader.get()));

Review Comment:
   Updated in 593720e9. The cache is now initialized with one null slot per 
reader, and the result of `dynamic_cast` is checked before a pointer is stored. 
Non-file readers keep their null slots so the cache remains aligned with 
`readers_` and the one-reader lookahead stays unchanged. `WarmupRange()` skips 
these null entries.



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

Reply via email to