yihua opened a new pull request, #1103:
URL: https://github.com/apache/hudi-rs/pull/1103
## Description
closes #1100
The HFile reader kept its data block index in a map keyed by each block's
first key. An HFile may repeat a key, so when one key's entries span three or
more blocks, two blocks share a first key and the second replaced the first in
the index. Key lookups, prefix lookups, full scans and iteration then skipped
that block. Prefix lookups also missed matching entries at the end of the block
before a separator, even when a key spanned only two blocks.
The index is now a list ordered by first key and block offset. A key lookup
selects the last block that starts below the key plus every block that starts
at it, and a prefix lookup starts from the last block below the prefix. The
single-level and multi-level index paths build the index the same way.
## How are the changes test-covered
- [ ] N/A
- [x] Automated tests (unit and/or integration tests)
- [ ] Manual tests
- [ ] Details are described below
New tests write HFiles where one key spans two, three and four blocks, and
check that key lookups, prefix lookups, full scans and iteration return every
entry in file order, on resident and ranged readers and through the multi-level
index path. They fail on main, where every path loses the middle block.
--
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]