Repository navigation
Conversation
Keep chunk and container metadata bound by reference on read-only paths, and move row-group metadata into the finalized Parquet Thrift structure instead of copying it. Replace the related empty-container checks with empty() for clarity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
The 4 failing tests are unrelated to the changes I made. |
HuaHuaY
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
I opened a small cleanup PR yesterday while getting familiar with the Arrow codebase. While continuing to read through the code, I noticed that some of the same patterns addressed in that PR were also present in other related code paths.
The earlier PR fixed these patterns in one place, but similar cases remained elsewhere. This PR applies the same small improvements to those remaining occurrences.
I also found that the Parquet metadata builder copied the complete row-group metadata vector when finalizing file metadata. Since the builder is finalizing its state at that point, the row-group metadata can be moved into the final Thrift structure instead. This avoids an unnecessary allocation and copy, particularly for files with many row groups.
What changes are included in this PR?
const auto&when the values are only read, avoiding unnecessary copies.size() == 0andsize() > 0checks withempty()and!empty(). I used the same style in my previous PR and found more places where it made the intent clearer while reading through the codebase.Are these changes tested?
No runtime tests were run locally.
I ran
git diff --checksuccessfully. A configured C++ build directory was not available in the checkout, so I was not able to run the focused Arrow or Parquet tests locally.Are there any user-facing changes?
No. There are no public API or serialized-format changes. The changes only avoid unnecessary copies and make existing container checks more direct.
Was AI used for this PR?
AI was used to help search through the codebase and inspect the relevant code paths. The changes and reasoning were reviewed before preparing this PR.
PR code and description written by:
Reviewed before submission by: