mapleFU commented on code in PR #39337:
URL: https://github.com/apache/arrow/pull/39337#discussion_r1440019827
##########
cpp/src/parquet/metadata.cc:
##########
@@ -1839,7 +1843,7 @@ class FileMetaDataBuilder::FileMetaDataBuilderImpl {
std::unique_ptr<FileMetaData> Finish(
const std::shared_ptr<const KeyValueMetadata>& key_value_metadata) {
int64_t total_rows = 0;
- for (auto row_group : row_groups_) {
+ for (const auto& row_group : row_groups_) {
Review Comment:
This is another problem I found during reading the code
##########
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.
Review Comment:
Here it might looks a bit hacking, this avoid copy the rowGroup in
`format::FileMetaData::FileMetaData`.
--
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]