You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by da...@apache.org on 2021/10/11 08:22:37 UTC

[hudi] branch master updated: [HUDI-2542] AppendWriteFunction throws NPE when checkpointing without written data (#3777)

This is an automated email from the ASF dual-hosted git repository.

danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b8bc66  [HUDI-2542] AppendWriteFunction throws NPE when checkpointing without written data (#3777)
5b8bc66 is described below

commit 5b8bc664a8dca97789c2472d633868fb8f553652
Author: Danny Chan <yu...@gmail.com>
AuthorDate: Mon Oct 11 16:22:22 2021 +0800

    [HUDI-2542] AppendWriteFunction throws NPE when checkpointing without written data (#3777)
---
 .../main/java/org/apache/hudi/sink/append/AppendWriteFunction.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hudi-flink/src/main/java/org/apache/hudi/sink/append/AppendWriteFunction.java b/hudi-flink/src/main/java/org/apache/hudi/sink/append/AppendWriteFunction.java
index 0279313..0c29578 100644
--- a/hudi-flink/src/main/java/org/apache/hudi/sink/append/AppendWriteFunction.java
+++ b/hudi-flink/src/main/java/org/apache/hudi/sink/append/AppendWriteFunction.java
@@ -122,6 +122,10 @@ public class AppendWriteFunction<I> extends AbstractStreamWriteFunction<I> {
   }
 
   private void flushData(boolean endInput) {
+    if (this.writerHelper == null) {
+      // does not process any inputs, returns early.
+      return;
+    }
     final List<WriteStatus> writeStatus = this.writerHelper.getWriteStatuses(this.taskID);
     final WriteMetadataEvent event = WriteMetadataEvent.builder()
         .taskID(taskID)