You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "siddiqueirshad (via GitHub)" <gi...@apache.org> on 2026/10/28 22:44:58 UTC
[PR] [HUDI-8935] Fix partitioned record index point lookups for empty keys or empty partitions [hudi]
siddiqueirshad opened a new pull request, #20461:
URL: https://github.com/apache/hudi/pull/20461
### Change Logs
In `HoodieBackedTableMetadata.lookupIndexRecords`, partition-scoped RLI lookups (`dataTablePartition.isPresent()`) previously filtered file slices by data partition, and then immediately evaluated `distinctSortedKeys.stream().findFirst().get()` and called `mapRecordKeyToFileGroupIndex(..., fileSlicesForDataPartition.size())`.
- When querying an empty partition (or one with no RLI file slices), `fileSlicesForDataPartition.size()` was 0, resulting in division by zero and an `ArithmeticException`.
- When querying with an empty key collection, `distinctSortedKeys` was empty, resulting in `NoSuchElementException`.
This PR adds an early return check returning `HoodieListData.lazy(Collections.emptyList())` when `fileSlicesForDataPartition.isEmpty() || keys.isEmpty()`, preventing exceptions and returning empty results as expected.
Fixes #20435.
### Impact
Prevents `ArithmeticException` and `NoSuchElementException` on point lookups when querying empty partitions or empty key collections in partitioned record index.
### Risk level
none
### Contributor Checklist
- [x] Commits are signed off (`git commit -s`)
- [x] Verified fix against edge cases
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-8935] Fix partitioned record index point lookups for empty keys or empty partitions [hudi]
Posted by "siddiqueirshad (via GitHub)" <gi...@apache.org>.
siddiqueirshad closed pull request #20461: [HUDI-8935] Fix partitioned record index point lookups for empty keys or empty partitions
URL: https://github.com/apache/hudi/pull/20461
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-8935] Fix partitioned record index point lookups for empty keys or empty partitions [hudi]
Posted by "siddiqueirshad (via GitHub)" <gi...@apache.org>.
siddiqueirshad commented on PR #20461:
URL: https://github.com/apache/hudi/pull/20461#issuecomment-6516138647
Hi @cshuo, thank you! That makes total sense, happy to consolidate and close this in favor of #20436.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-8935] Fix partitioned record index point lookups for empty keys or empty partitions [hudi]
Posted by "cshuo (via GitHub)" <gi...@apache.org>.
cshuo commented on PR #20461:
URL: https://github.com/apache/hudi/pull/20461#issuecomment-6495459493
Thanks! This duplicates https://github.com/apache/hudi/pull/20436, which includes regression tests and updates the rollback tests that still expect `ArithmeticException`. Could we consolidate there?
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org