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 19b3e7fea14 [Minor] Throws an exception when using bulk_insert and 
stream mode (#10082)
19b3e7fea14 is described below

commit 19b3e7fea14844b0e03ba58f4c269fcb74079ced
Author: leixin <[email protected]>
AuthorDate: Wed Nov 15 09:24:29 2023 +0800

    [Minor] Throws an exception when using bulk_insert and stream mode (#10082)
    
    Co-authored-by: leixin1 <[email protected]>
---
 .../src/main/java/org/apache/hudi/table/HoodieTableSink.java         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSink.java
 
b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSink.java
index e80e2510a65..94676e6208e 100644
--- 
a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSink.java
+++ 
b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSink.java
@@ -26,6 +26,7 @@ import org.apache.hudi.common.model.WriteOperationType;
 import org.apache.hudi.configuration.FlinkOptions;
 import org.apache.hudi.configuration.OptionsInference;
 import org.apache.hudi.configuration.OptionsResolver;
+import org.apache.hudi.exception.HoodieException;
 import org.apache.hudi.sink.utils.Pipelines;
 import org.apache.hudi.util.ChangelogModes;
 import org.apache.hudi.util.DataModificationInfos;
@@ -86,6 +87,10 @@ public class HoodieTableSink implements
 
       // bulk_insert mode
       if (OptionsResolver.isBulkInsertOperation(conf)) {
+        if (!context.isBounded()) {
+          throw new HoodieException(
+              "The bulk insert should be run in batch execution mode.");
+        }
         return Pipelines.bulkInsert(conf, rowType, dataStream);
       }
 

Reply via email to