lidavidm commented on code in PR #36192:
URL: https://github.com/apache/arrow/pull/36192#discussion_r1243627575
##########
cpp/src/parquet/file_reader.cc:
##########
@@ -297,9 +302,17 @@ class SerializedFile : public ParquetFileReader::Contents {
}
std::shared_ptr<RowGroupReader> GetRowGroup(int i) override {
+ std::unordered_set<int> prebuffered_column_chunks;
+ // Avoid updating the map as this function can be called concurrently. The
map can
+ // only be updated within Prebuffer().
+ auto prebuffered_column_chunks_iter = prebuffered_column_chunks_.find(i);
+ if (prebuffered_column_chunks_iter != prebuffered_column_chunks_.end()) {
+ prebuffered_column_chunks = prebuffered_column_chunks_iter->second;
+ }
+
std::unique_ptr<SerializedRowGroup> contents =
std::make_unique<SerializedRowGroup>(
source_, cached_source_, source_size_, file_metadata_.get(), i,
properties_,
- file_decryptor_);
+ prebuffered_column_chunks, file_decryptor_);
Review Comment:
The move here means that if you read this row group again, it won't make use
of the pre-buffered data. Is that intentional? If so, it may be clearer to
explicitly erase the map entry after moving as well.
--
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]