mapleFU commented on code in PR #39337:
URL: https://github.com/apache/arrow/pull/39337#discussion_r1455245456
##########
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);
Review Comment:
The origin code don't copying the previous row-group. If we have a large
file with many row-groups (it's possible), the more around of copy waste a lot
of cpu time. So I do this as an optimization.
--
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]