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

   ### Describe the issue this Pull Request addresses
   
   Per-`HoodieFileFormat` dispatch is duplicated across factory overloads and 
utility switches, so adding a format can cover one dispatch point and miss 
another. That bug class shipped twice with the Vortex integration (the 
`StoragePathInfo` reader overload and the log-block-type selection, both fixed 
in #19252). This PR adds tests that catch such asymmetries mechanically.
   
   ### Summary and Changelog
   
   - Add `TestFileFormatDispatchCoverage` (hudi-hadoop-common): iterates 
`HoodieFileFormat.values()` (never a hardcoded list) and asserts the 
`StoragePath` and `StoragePathInfo` overloads of 
`HoodieFileReaderFactory#getFileReader` dispatch consistently, the 
extension-based entry agrees with the format switch, 
`HoodieHadoopIOFactory#getFileFormatUtils` throws only 
`UnsupportedOperationException` for unsupported formats, and the 
utils-supported set covers every reader-dispatchable format. Per-format factory 
hooks are intercepted by method-name pattern (`new*` returning 
`HoodieFileReader`), so a hook added for a future format is covered without 
updating the test.
   - Add `TestFileFormatDispatchCoverage` (hudi-client-common): asserts 
`CommonClientUtils#getLogBlockType` maps every base file format to a log block 
type and `shouldWriteNativeLogs` never throws and never selects native logs 
below table version ten.
   - Three VORTEX cases are `@Disabled` referencing #19252 (this base predates 
the fix); they assert the post-fix behavior and will be enabled once #19252 
merges. Un-disabling them against current master reproduces all three shipped 
bugs verbatim.
   
   ### Impact
   
   Test-only. Future `HoodieFileFormat` additions that miss a dispatch point 
fail these tests instead of failing at runtime.
   
   ### Risk Level
   
   low
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] 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