wombatu-kun commented on code in PR #20436:
URL: https://github.com/apache/hudi/pull/20436#discussion_r4373834306
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -280,9 +280,17 @@ private HoodieData<HoodieRecord<HoodieMetadataPayload>>
lookupIndexRecords(Hoodi
List<FileSlice> fileSlicesForDataPartition = fileSlices.stream()
.filter(fileSlice ->
HoodieTableMetadataUtil.getDataTablePartitionNameFromFileGroupName(fileSlice.getFileId()).equals(dataTablePartition.get()))
.collect(Collectors.toList());
- // all keys will be from the same shard index so just calculate the
first key and reduce partitionFileSlices to 1
+ // The whole-index slice check has already passed; a new data partition
may still have no shards.
+ if (fileSlicesForDataPartition.isEmpty()) {
Review Comment:
`TestRecordLevelIndex.testPartitionedRecordLevelIndexRollback` still expects
the `partition0` lookup after the rollback to throw `ArithmeticException`, so
all four of its cases now fail and `test-spark-java17-java-tests-part2` is red.
It should `assertTrue(readRecordIndex(metadata, holder.bulkRecordKeys,
HOption.of("partition0")).isEmpty)` instead, and the now-dead
`ArithmeticException` catch in `getRecordIndexEntries` can go too.
--
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]