Repository navigation
GH-55325: [C++][Python] Accept known metadata in Parquet fragments - #55391
nikhilred2619 wants to merge 1 commit into
Conversation
|
|
|
This is a new PR. You should be able to see checkboxes in the PR description template regarding AI-generated code https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code. Why were they removed? Also, the PR title has been truncated too much due to length limits—have you verified it manually? |
|
Hi ,could you please take a look at my PR when you get a chance? If anything needs to be changed or improved, please let me know. I'll be happy to make the changes. Thanks for your time! |
|
Could you rebase on latest main? I think the CI might improve with that. |
Allow callers to provide known Parquet FileMetaData when constructing ParquetFileFragment objects, avoiding redundant footer reads. Expose per-file metadata subset selection and cover row-group pruning, metadata lifetime, and no-I/O fragment construction with regression tests.
766897f to
fdd955f
Compare
|
Hi @AlenkaF, Thanks for taking a look. I've rebased the PR onto the latest Please let me know if anything else needs to be addressed. Thanks again! |
|
Hi @AlenkaF, all 11 CI workflows are now passing after the rebase. Thanks for your guidance! |
Rationale for this change
This PR addresses #55325 by allowing existing Parquet
FileMetaDatato be supplied directly when constructing aParquetFileFragment.Currently, even when metadata is already available from a combined
_metadatafile, creating fragments can require additional reads of individual Parquet file footers.The implementation follows the construction-time approach discussed in the issue. Metadata is attached when the fragment is created, avoiding unnecessary file I/O and preserving the existing fragment lifecycle.
What changes are included in this PR?
ParquetFileFormat::MakeFragmentoverload that accepts preloadedFileMetaData.SetMetadata()implementation to initialize the fragment with its metadata and schema information.ParquetFileFormat.make_fragment()with an optionalmetadataparameter.FileMetaData.subset()to extract selected row groups from existing metadata.The existing fragment creation path remains unchanged when metadata is not provided.
Are these changes tested?
The development verification produced the following results:
The patch was also verified to apply cleanly against the current upstream
mainbranch.The tests have not been rerun on the submitted branch. GitHub CI verification is pending.
A local benchmark also confirmed that short-lived fragments can avoid repeated footer reads and reduce retained memory when metadata is stored compactly. The latency measurements used simulated storage delays rather than a live S3 environment.
Are there any user-facing changes?
Yes.
Python users can now supply existing metadata through the optional
metadataparameter when creating Parquet fragments.The new
FileMetaData.subset()method also allows callers to select row groups from existing metadata.These are additive API changes. Existing calls remain supported. Invalid negative row-group indices now raise an error.
Was AI used for this PR?
PR code and description written by:
[ ] Human
[x] AI
Reviewed before submission by:
[x] Human
[] AI
[ ] Not reviewed
AI assistance was used for the implementation, regression tests, and PR description. Before submitting, I checked that the changes matched the agreed issue requirements and verified that the patch applied cleanly to the upstream main branch.
Fixes #55325.