danny0405 commented on code in PR #13830:
URL: https://github.com/apache/hudi/pull/13830#discussion_r2320677823


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -620,8 +619,10 @@ public static <R> HoodieData<HoodieRecord<R>> 
tagGlobalLocationBackToRecords(
           if (currentLocOpt.isPresent()) {
             HoodieRecordGlobalLocation currentLoc = currentLocOpt.get();
             boolean shouldDoMergedLookUpThenTag = mayContainDuplicateLookup
-                || !Objects.equals(incomingRecord.getPartitionPath(), 
currentLoc.getPartitionPath());
-            if (shouldUpdatePartitionPath && shouldDoMergedLookUpThenTag) {
+                || !Objects.equals(incomingRecord.getPartitionPath(), 
currentLoc.getPartitionPath())
+                // if the ordering is not simply based on commit time and the 
incoming record is a delete, the value needs to be compared to the existing 
value before deleting the key from the index
+                || (!isCommitTimeOrdered && 
incomingRecord.isDelete(writerSchema.get(), properties));
+            if ((shouldUpdatePartitionPath || isMoRTable) && 
shouldDoMergedLookUpThenTag) {

Review Comment:
   Maybe we just need to set the `mayContainDuplicateLookup` also to true for 
MOR table RLI index directly if it means the incoming records allow duplicates.



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