hudi-agent commented on code in PR #20138:
URL: https://github.com/apache/hudi/pull/20138#discussion_r4135365122


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteFunction.java:
##########
@@ -589,7 +590,7 @@ private void sortBucketIfNeeded(RowDataBucket 
rowDataBucket) {
       return;
     }
     try {
-      rowDataBucket.sort();
+      rowDataBucket.sort(readerContext.getMergeMode() == 
RecordMergeMode.COMMIT_TIME_ORDERING);

Review Comment:
   🤖 Should `EVENT_TIME_ORDERING` (and CUSTOM/payload modes) get the stable 
sort too? `shouldKeepNewerRecord` uses `compareTo(...) >= 0`, so when two 
records tie on ordering value, the later arrival is meant to win. With the 
key-only QuickSort, which record wins those ties is effectively arbitrary.
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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