danny0405 opened a new pull request, #19347: URL: https://github.com/apache/hudi/pull/19347
### Describe the issue this Pull Request addresses The LSM file-group read path in `hudi-common` had limited coverage around sorted-run merging, delete handling, reader lifecycle and output modes, and disk spilling. Several adjacent read-path branches also lacked focused edge-case coverage. ### Summary and Changelog This PR adds focused unit coverage for the LSM file-group reader and iterator stack. - Builds an in-memory LSM fixture with a base run, multiple sorted L0 runs, and a native delete run. - Verifies event-time merging, deterministic key ordering, delete suppression, and log-only reads. - Forces L0 runs through `SpillableLsmRecordIterator` with a direct-reader threshold of one. - Covers all public `HoodieLsmFileGroupReader` iterator modes and reader replacement/close behavior. - Adds position-based cardinality, key-filtering, and fallback edge cases. - Covers buffered merger selection and incremental query range boundaries. | Class | Before | After | | --- | ---: | ---: | | `LsmFileGroupRecordIterator` | 39% | 93.7% | | `HoodieLsmFileGroupReader` | 0% | 93.5% | | `PositionBasedFileGroupRecordBuffer` | 74% | >=85% merged | | `SpillableLsmRecordIterator` | 73% | 85.9% | | `BufferedRecordMergerFactory` | 90% | >=90% | | `IncrementalQueryAnalyzer` | 90% | >=90% | The exact merged percentages for classes covered by tests in multiple modules will be confirmed by Codecov CI. ### Impact No public API or runtime behavior changes. This PR only adds tests and improves regression coverage for the common read path. ### Risk Level Low. The changes are test-only and the targeted suite passes with zero Checkstyle violations. Validation: ``` mvn -pl hudi-common -Punit-tests -DskipITs -Drat.skip=true -Dtest=TestHoodieLsmFileGroupReader,TestLsmFileGroupRecordIterator,TestSpillableLsmRecordIterator,TestBufferedRecordMergerFactory,TestIncrementalQueryAnalyzer,TestPositionBasedFileGroupRecordBuffer test ``` 17 tests passed with no failures. ### 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]
