pengzhiwei2018 commented on a change in pull request #2645:
URL: https://github.com/apache/hudi/pull/2645#discussion_r615507564



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/model/DefaultHoodieRecordPayload.java
##########
@@ -97,4 +86,22 @@ public DefaultHoodieRecordPayload(Option<GenericRecord> 
record) {
     }
     return metadata.isEmpty() ? Option.empty() : Option.of(metadata);
   }
+
+  protected boolean needUpdatePersistedRecord(IndexedRecord currentValue,
+                                              IndexedRecord incomingRecord, 
Properties properties) {
+    /*
+     * Combining strategy here returns currentValue on disk if incoming record 
is older.
+     * The incoming record can be either a delete (sent as an upsert with 
_hoodie_is_deleted set to true)
+     * or an insert/update record. In any case, if it is older than the record 
in disk, the currentValue
+     * in disk is returned (to be rewritten with new commit time).
+     *
+     * NOTE: Deletes sent via EmptyHoodieRecordPayload and/or Delete operation 
type do not hit this code path

Review comment:
       Yes, It is used by the HoodieMergeHandle. Here I just put the original 
code into the `needUpdatePersistedRecord`, which can used by the sub-class of 
`DefaultHoodieRecordPayload`.e .g. `ExpressionPayload`.  It is just a code 
refactor here.




-- 
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:
us...@infra.apache.org


Reply via email to