HippoBaro opened a new pull request, #12370:
URL: https://github.com/apache/arrow-rs/pull/12370

   # Which issue does this PR close?
   
   - Contributes to #12364
   - Part of series #12367 
   
   # Rationale for this change
   
   The metadata-extension support proposed in #12364 needs a way to identify 
fields within encoded Parquet metadata structures. Applications should be able 
to refer to those fields by name rather than maintaining their own copies of 
the codecs' numeric field IDs.
   
   This PR introduces that building block in isolation: named Thrift field IDs 
shared by the codecs and application code. For example, 
`file_meta_data::ROW_GROUPS` identifies field `4` of `FileMetaData`, and 
`row_group::COLUMNS` identifies field `1` of `RowGroup`. IDs are scoped to 
their containing struct or union. These constant are part of the Parquet 
standard, and not implementation specific. 
   
   # What changes are included in this PR?
   
   - Add `parquet::file::metadata::thrift_fields`, with `i16` constants grouped 
by their containing Thrift struct or union. Coverage includes footer and schema 
metadata, page headers, page indexes, statistics, logical types, Bloom filters, 
and encryption metadata.
   - Replace numeric field IDs in handwritten and macro-generated codecs with 
those same constants, retaining their existing values and wire representation.
   - Extend the Thrift struct and union macros to accept constant paths as well 
as numeric literals.
   - Keep the namespace available internally in all builds, exposing it 
externally only with the `experimental` feature, following the crate's 
hidden-public API convention.
   
   # Are these changes tested?
   
   The existing metadata codec, round-trip, and file-fixture tests exercise the 
migrated readers and writers, including the page-index, Bloom-filter, and 
encryption paths. Existing literal-based macro uses remain supported, while 
migrated codec definitions exercise constant-path field IDs. These checks 
passed for this isolated commit during local per-commit validation.
   
   The new namespace also includes a documentation example demonstrating the 
named field IDs. No extension read/write functionality is introduced in this PR.
   
   # Are there any significant user-facing changes?
   
   No changes to the default public API or Parquet wire format are intended. 
The new field-ID namespace requires `experimental`, is hidden from generated 
API documentation, and may change between minor releases.
   
   # AI usage disclosure
   
   AI tools assisted with implementation and refactoring, tests, the executable 
example, documentation, and code review. I fully own the changes, including 
design, scope decisions and implementation details.


-- 
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]

Reply via email to