Skip to content

Commit 348ceda

Browse files
committed
[HUDI-4536] ClusteringOperator causes the NullPointerException when writing with BulkInsertWriterHelper in clustering
1 parent c72d895 commit 348ceda

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

hudi-common/src/main/java/org/apache/hudi/common/fs/HoodieWrapperFileSystem.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,10 @@ public void createImmutableFileInPath(Path fullPath, Option<byte[]> content)
10151015
boolean needTempFile = needCreateTempFile();
10161016

10171017
try {
1018+
if (exists(fullPath)) {
1019+
return;
1020+
}
1021+
10181022
if (!content.isPresent()) {
10191023
fsout = fileSystem.create(fullPath, false);
10201024
}

hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/clustering/ClusteringOperator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ private void doClustering(String instantTime, ClusteringPlanEvent event) throws
233233

234234
List<WriteStatus> writeStatuses = this.writerHelper.getWriteStatuses(this.taskID);
235235
collector.collect(new ClusteringCommitEvent(instantTime, writeStatuses, this.taskID));
236+
this.writerHelper = null;
236237
}
237238

238239
private void initWriterHelper(String clusteringInstantTime) {

0 commit comments

Comments
 (0)