prashantwason commented on a change in pull request #1687:
URL: https://github.com/apache/hudi/pull/1687#discussion_r435495315



##########
File path: hudi-client/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
##########
@@ -214,6 +223,36 @@ private boolean writeRecord(HoodieRecord<T> hoodieRecord, 
Option<IndexedRecord>
    */
   public void write(GenericRecord oldRecord) {
     String key = 
oldRecord.get(HoodieRecord.RECORD_KEY_METADATA_FIELD).toString();
+
+    if (hoodieTable.requireSortedRecords()) {
+      // To maintain overall sorted order across updates and inserts, write 
any new inserts whose keys are less than
+      // the oldRecord's key.
+      while (!newRecordKeysSorted.isEmpty() && 
newRecordKeysSorted.peek().compareTo(key) <= 0) {

Review comment:
       Sure. BTW this is the merge sort style merge you pointed in the previous 
comment.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to