Reo-LEI commented on a change in pull request #2898:
URL: https://github.com/apache/iceberg/pull/2898#discussion_r718284324



##########
File path: flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
##########
@@ -144,13 +144,14 @@ private Builder forRowData(DataStream<RowData> 
newRowDataInput) {
                                             MapFunction<T, RowData> mapper,
                                             TypeInformation<RowData> 
outputType) {
       this.inputCreator = newUidPrefix -> {
+        // Input stream order is crucial for some situation(e.g. in cdc case). 
Therefore, we need to set the parallelism
+        // of map operator same as it's input to keep map operator chaining 
it's input, and avoid rebalanced by default.
+        SingleOutputStreamOperator<RowData> inputStream = input.map(mapper, 
outputType)
+            .setParallelism(input.getParallelism());

Review comment:
       I will add am unit test to cover this.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to