linliu-code commented on code in PR #13498:
URL: https://github.com/apache/hudi/pull/13498#discussion_r2200987832


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/BufferedRecordMergerFactory.java:
##########
@@ -126,6 +190,73 @@ public Pair<Boolean, T> finalMerge(BufferedRecord<T> 
olderRecord, BufferedRecord
     }
   }
 
+  /**
+   * An implementation of {@link EventTimeBufferedRecordMerger} which merges 
{@link BufferedRecord}s
+   * based on {@code EVENT_TIME_ORDERING} merge mode and partial update mode.
+   */
+  private static class EventTimeBufferedRecordPartialUpdateMerger<T> extends 
EventTimeBufferedRecordMerger<T> {
+    private final PartialUpdateStrategy<T> partialUpdateStrategy;
+    private final HoodieReaderContext<T> readerContext;
+
+    public EventTimeBufferedRecordPartialUpdateMerger(HoodieReaderContext<T> 
readerContext,
+                                                      PartialUpdateMode 
partialUpdateMode,
+                                                      TypedProperties props) {
+      this.partialUpdateStrategy = new PartialUpdateStrategy<>(readerContext, 
partialUpdateMode, props);
+      this.readerContext = readerContext;
+    }
+
+    @Override
+    public Option<BufferedRecord<T>> deltaMerge(BufferedRecord<T> newRecord, 
BufferedRecord<T> existingRecord) {
+      if (existingRecord == null || shouldKeepNewerRecord(existingRecord, 
newRecord)) {
+        newRecord = partialUpdateStrategy.partialMerge(
+            newRecord,
+            existingRecord,
+            readerContext.getSchemaFromBufferRecord(newRecord),
+            readerContext.getSchemaFromBufferRecord(existingRecord),

Review Comment:
   Done.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to