cshuo opened a new pull request, #19129:
URL: https://github.com/apache/hudi/pull/19129

   ### Describe the issue this Pull Request addresses
   
   HFile footer metadata is used by shared file-format utilities, but the HFile 
path did not support reading footer metadata and the Avro HFile writer did not 
expose a way to write custom footer entries. This left HFile inconsistent with 
other storage formats for metadata-driven flows that need to persist and 
retrieve footer-level information.
   
   This PR adds read/write support for HFile footer metadata and covers both 
optional and required metadata lookup behavior.
   
   ### Summary and Changelog
   
   - Implemented `HFileUtils.readFooter` by opening an `HFileReader`, reading 
requested metadata keys via `getMetaInfo`, decoding UTF-8 values, and throwing 
`MetadataNotFoundException` when required metadata is missing.
   - Added `HoodieAvroHFileWriter.addFooterMetadata` to append footer metadata 
entries through HFile file info.
   - Added `TestHoodieHFileReaderWriter.testReadFooterMetadata` to verify 
custom footer metadata, native log footer metadata, optional missing keys, and 
required missing-key failures.
   
   ### Impact
   
   - **Functional impact**: HFile now supports writing and reading footer 
metadata through the existing file-format utility and writer APIs.
   - **Maintainability**: HFile footer handling is aligned with the shared 
`FileFormatUtils.readFooter` contract instead of throwing 
`UnsupportedOperationException`.
   - **Extensibility**: Enables future HFile-backed metadata flows that need 
footer-level schema or custom metadata entries.
   
   ### Risk Level
   
   low. 
   
   ### Documentation Update
   
   none.
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Enough context is provided in the sections above
   - [ ] Adequate tests were added if applicable


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