beyond1920 commented on code in PR #10898:
URL: https://github.com/apache/hudi/pull/10898#discussion_r1534957853
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -61,6 +64,20 @@ public Map<Integer, HoodieRecordLocation>
loadBucketIdToFileIdMappingForPartitio
if (!bucketIdToFileIdMapping.containsKey(bucketId)) {
bucketIdToFileIdMapping.put(bucketId, new
HoodieRecordLocation(commitTime, fileId));
} else {
+ // If hoodie.write.bucketid.multiple.delete.partition enable,
delete the partition to confirm next write is success
+ if (config.getWhetherDeletePartitonWhenBucketIdMultiple()) {
+ Path partitionPath =
FSUtils.getPartitionPath(hoodieTable.getMetaClient().getBasePathV2(),
partition);
+ try {
+ hoodieTable.getMetaClient().getFs().delete(partitionPath,
true);
+ } catch (IOException e) {
+ throw new HoodieIOException("Find multiple files at partition
path="
+ + partition + " belongs to the same bucket id = " +
bucketId, e);
+ }
+ throw new HoodieIOException("Find multiple files at partition
path="
+ + partition + " belongs to the same bucket id = " +
bucketId
+ + ", and had deleted the partition path, you can try the
job again");
+ }
+
Review Comment:
I'm not sure whether it's safe to delete it directly.
--
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]