danny0405 commented on code in PR #8300:
URL: https://github.com/apache/hudi/pull/8300#discussion_r1163569337
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/RDDCustomColumnsSortPartitioner.java:
##########
@@ -61,13 +61,8 @@ public JavaRDD<HoodieRecord<T>>
repartitionRecords(JavaRDD<HoodieRecord<T>> reco
final boolean consistentLogicalTimestampEnabled =
this.consistentLogicalTimestampEnabled;
return records.sortBy(
record -> {
- Object recordValue = record.getColumnValues(schema.get(),
sortColumns, consistentLogicalTimestampEnabled);
- // null values are replaced with empty string for null_first order
- if (recordValue == null) {
- return StringUtils.EMPTY_STRING;
- } else {
- return StringUtils.objToString(recordValue);
- }
+ Object[] columnValues = record.getColumnValues(schema.get(),
sortColumns, consistentLogicalTimestampEnabled);
+ return FlatLists.ofComparableArray(columnValues);
Review Comment:
The default behavior is null_last, the original comment is wrong, it
returned empty string for nulls, empty string should be always smaller than non
empty strings.
--
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]