xuzifu666 commented on code in PR #10180:
URL: https://github.com/apache/hudi/pull/10180#discussion_r1405687916


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/utils/Pipelines.java:
##########
@@ -213,12 +215,31 @@ public static DataStream<Object> append(
       Configuration conf,
       RowType rowType,
       DataStream<RowData> dataStream) {
+    Option<Partitioner> insertPartitioner = getInsertPartitioner(conf);
+    DataStream<RowData> finalDataStream;
+
+    if (insertPartitioner.isPresent()) {
+      RowDataKeyGen rowDataKeyGen = RowDataKeyGen.instance(conf, rowType);
+      finalDataStream = dataStream.partitionCustom(insertPartitioner.get(), 
rowDataKeyGen::getHoodieKey);
+    } else {
+      finalDataStream = dataStream;
+    }
+
     WriteOperatorFactory<RowData> operatorFactory = 
AppendWriteOperator.getFactory(conf, rowType);
 
-    return dataStream
-        .transform(opName("hoodie_append_write", conf), 
TypeInformation.of(Object.class), operatorFactory)
-        .uid(opUID("hoodie_stream_write", conf))
-        .setParallelism(conf.getInteger(FlinkOptions.WRITE_TASKS));
+    return finalDataStream
+        .transform(opName("hoodie_append_write", conf), 
TypeInformation.of(Object.class), operatorFactory);

Review Comment:
   ```suggestion
           .transform(opName("hoodie_append_write", conf), 
TypeInformation.of(Object.class), operatorFactory)
           .setParallelism(conf.getInteger(FlinkOptions.WRITE_TASKS));
   ```



-- 
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]

Reply via email to