GH-38149: [C++][Parquet] Avoid rebuilding column paths during schema initialization - #51400
Draft
namtran1812 wants to merge 1 commit into
Draft
namtran1812 wants to merge 1 commit into
namtran1812 wants to merge 1 commit into
Conversation
namtran1812
requested review from
HuaHuaY,
pitrou and
wgtmac
as code owners
September 20, 2026 18:26
|
Thanks for opening a pull request! This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format. If this is not a minor PR, could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or After updating the title, you can mark the pull request as ready for review. See also: |
|
|
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
SchemaDescriptor::BuildTreecurrently constructs each leaf's dot-separated path throughnode->path()->ToDotString(). For wide schemas, this repeatedly walks parent links and creates temporary path and string objects for every leaf during schema initialization.This change reduces that overhead. It is relevant to the wide-schema metadata costs discussed in #38149, although it does not eliminate full-schema metadata deserialization or fully resolve selective column reads.
What changes are included in this PR?
leaf_to_idx_.ReadFileMetadatabenchmarks with 5K, 10K, 20K, and 50K-column single-row-group cases.Local benchmark results (median wall time):
The 50K-column case showed higher variance than the smaller cases. Across these measurements, metadata-read time improved by approximately 11–15%.
Are these changes tested?
Yes.
parquet-schema-test: 44/44 tests passed.TestSchemaDescriptor.ColumnIndexDuplicatePathto cover duplicate-path identity lookup.git diff --checkpasses.Are there any user-facing changes?
No. This is an internal Parquet schema initialization optimization with no intended public API or behavioral changes.
Was AI used for this PR?
AI was used to assist with implementation analysis, review, testing strategy, and drafting the PR description. The changes and benchmark/test results were reviewed and validated locally before submission.
PR code and description written by:
Reviewed before submission by: