wgtmac commented on code in PR #39337:
URL: https://github.com/apache/arrow/pull/39337#discussion_r1447039343


##########
cpp/src/parquet/metadata.cc:
##########
@@ -793,26 +793,29 @@ class FileMetaData::FileMetaDataImpl {
 
     std::shared_ptr<FileMetaData> out(new FileMetaData());
     out->impl_ = std::make_unique<FileMetaDataImpl>();
-    out->impl_->metadata_ = std::make_unique<format::FileMetaData>();
-
-    auto metadata = out->impl_->metadata_.get();
-    metadata->version = metadata_->version;
-    metadata->schema = metadata_->schema;
+    {
+      // GH-39336: Copy the metadata, but only the row groups we need.
+      auto temp_row_groups = std::move(this->metadata_->row_groups);
+      try {

Review Comment:
   I'm not sure if it worths this kind of complexity to handle the exception 
just in order to avoid the copy.



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