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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergedReadHandle.java:
##########
@@ -166,6 +167,17 @@ private List<HoodieRecord<T>> 
doMergedRead(Option<HoodieFileReader> baseFileRead
         String key = record.getRecordKey();
         if (deltaRecordMap.containsKey(key)) {
           deltaRecordKeys.remove(key);
+
+          // When we find a processing time based delete, e.g., a delete 
record without valid ordering value,
+          // or with default ordering value, i.e., 0, we can safely ignore 
records before the delete record.
+          // That means, we can return the log record without merging with the 
record from base file.
+          if 
(deltaRecordMap.get(key).getMetaDataInfo(DELETE_FOUND_WITHOUT_ORDERING_VALUE).isPresent())
 {
+            if (!deltaRecordMap.get(key).isDelete(readerSchema, 
config.getProps())) {

Review Comment:
   data record can also be here, since this information need to be kept until 
the merging with the record from base file. After the delete, new insert or 
update records could be added for the same key. In more details, suppose we 
have a base file, and 4 log files. for rk, we have records, bfr, lfr1, lfr2, 
lfr3(the delete), lfr4. Since in the end bfr should be merged with lfr4, lfr4 
should have this meta info even lfr4 is an insert or update.
   



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