jp0317 commented on code in PR #36192:
URL: https://github.com/apache/arrow/pull/36192#discussion_r1243719449


##########
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:
   I'm not sure why it won't use the prebuffer as this 
`prebuffered_column_chunks` is a local object. Could you please elaborate?



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