Skip to content

Commit 907d6ed

Browse files
committed
Fix FileId not found exception when FileId is passed to HoodieMergeHandle
1 parent dfac123 commit 907d6ed

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

hudi-common/src/main/java/org/apache/hudi/common/table/view/TableFileSystemView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ interface SliceView extends SliceViewWithLatestSlice {
157157

158158
/**
159159
* Stream all the file groups for a given partition.
160+
* <p>
161+
* Note: This method will return all file groups in a partition, i.e. uncommitted filegroups will be returned
160162
*/
161163
Stream<HoodieFileGroup> getAllFileGroups(String partitionPath);
162164

hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/bucket/BucketStreamWriteFunction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ private void bootstrapIndexIfNeed(String partition) {
157157

158158
// Load existing fileID belongs to this task
159159
Map<Integer, String> bucketToFileIDMap = new HashMap<>();
160-
this.writeClient.getHoodieTable().getHoodieView().getAllFileGroups(partition).forEach(fileGroup -> {
161-
String fileID = fileGroup.getFileGroupId().getFileId();
160+
this.writeClient.getHoodieTable().getHoodieView().getLatestBaseFiles(partition).forEach(baseFile -> {
161+
String fileID = baseFile.getFileId();
162162
int bucketNumber = BucketIdentifier.bucketIdFromFileId(fileID);
163163
if (isBucketToLoad(bucketNumber, partition)) {
164164
LOG.info(String.format("Should load this partition bucket %s with fileID %s", bucketNumber, fileID));

0 commit comments

Comments
 (0)