danny0405 commented on code in PR #7795:
URL: https://github.com/apache/hudi/pull/7795#discussion_r1092668275


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/utils/Pipelines.java:
##########
@@ -150,6 +150,22 @@ public static DataStreamSink<Object> 
bulkInsert(Configuration conf, RowType rowT
             conf.getInteger(FlinkOptions.WRITE_SORT_MEMORY) * 1024L * 1024L);
       }
     }
+
+    final String[] recordKeyFields = 
conf.getString(FlinkOptions.RECORD_KEY_FIELD).split(",");
+    if (recordKeyFields.length > 0) {
+      if 
(conf.getBoolean(FlinkOptions.WRITE_BULK_INSERT_SORT_INPUT_BY_RECORD_KEY)) {
+        SortOperatorGen sortOperatorGen = new SortOperatorGen(rowType, 
recordKeyFields);
+        // sort by record keys
+        dataStream = dataStream
+            .transform("record_key_sorter",
+                InternalTypeInfo.of(rowType),
+                sortOperatorGen.createSortOperator())

Review Comment:
   Is the partition key sequence broken by the re-sort of record key?



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