danny0405 commented on code in PR #7795:
URL: https://github.com/apache/hudi/pull/7795#discussion_r1096892039
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/utils/Pipelines.java:
##########
@@ -139,10 +142,19 @@ public static DataStreamSink<Object>
bulkInsert(Configuration conf, RowType rowT
dataStream = dataStream.partitionCustom(partitioner,
rowDataKeyGen::getPartitionPath);
}
if (conf.getBoolean(FlinkOptions.WRITE_BULK_INSERT_SORT_INPUT)) {
- SortOperatorGen sortOperatorGen = new SortOperatorGen(rowType,
partitionFields);
- // sort by partition keys
+ String[] sortFields = partitionFields;
+ String operatorName = "partition_key_sorter";
+ if
(conf.getBoolean(FlinkOptions.WRITE_BULK_INSERT_SORT_INPUT_BY_RECORD_KEY)) {
+ String[] recordKeyFields =
conf.getString(FlinkOptions.RECORD_KEY_FIELD).split(",");
+ ArrayList<String> sortList = new
ArrayList<>(Arrays.asList(partitionFields));
+ Collections.addAll(sortList, recordKeyFields);
+ sortFields = sortList.toArray(new String[0]);
+ operatorName = "partition_and_record_key_sorter";
Review Comment:
```suggestion
operatorName = "sorter:(partition_key, 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]