vortual commented on code in PR #7795:
URL: https://github.com/apache/hudi/pull/7795#discussion_r1095633522
##########
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:
I didn't notice that would broke partition key sequence. I have modified the
code, please help review it again, thks
--
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]