cshuo opened a new pull request, #19200: URL: https://github.com/apache/hudi/pull/19200
### Describe the issue this Pull Request addresses Native log files store record-position metadata in the existing `RECORD_POSITIONS` footer entry, but the previous bitmap encoding decodes positions in sorted order. Position-based merging pairs log records with positions by index, so native log records must preserve the same order used when records are written and read from the native data/delete files. This PR updates native log position metadata to preserve insert order while keeping inline log blocks on the existing bitmap path. Fixes #19178 ### Summary and Changelog - Add raw long-list encoding and decoding helpers in `LogReaderUtils` for native log record positions. - Write native data/delete log positions as ordered long lists in `HoodieNativeLogFormatWriter`, while dropping position metadata when invalid positions are found. - Add `HoodieLogBlock#getRecordPositionList()` as the reader-facing API and route position-based merge through it. - Override native data/delete blocks to decode native `RECORD_POSITIONS` with the ordered long-list format. - Update tests to cover out-of-order and duplicate native positions, native delete positions, inline bitmap compatibility, and MOR record-position validation. ### Impact - **Functional impact**: native log record positions now preserve file write/read order, allowing position-based merging to align records and positions correctly. - **Maintainability**: separates native ordered-list decoding from inline bitmap decoding behind `getRecordPositionList()`. - **Extensibility**: keeps the existing `RECORD_POSITIONS` metadata key while allowing block implementations to choose the correct decoding format. ### Risk Level Low. The change is scoped to record-position metadata encoding/decoding and position-based merge extraction. Inline log blocks continue to use the existing bitmap decoder, while native data/delete blocks use the new ordered decoder. Tests were updated across native writer, log utility, log block, and MOR storage validation paths. ### 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]
