nsivabalan commented on code in PR #12105:
URL: https://github.com/apache/hudi/pull/12105#discussion_r1816014433


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -840,12 +840,17 @@ private Map<String, String> 
reverseLookupSecondaryKeys(String partitionName, Lis
       }
 
       Set<String> keySet = new TreeSet<>(recordKeys);
+      Set<String> deletedRecordsFromLogs = new HashSet<>();
       Map<String, HoodieRecord<HoodieMetadataPayload>> logRecordsMap = new 
HashMap<>();
       logRecordScanner.getRecords().forEach(record -> {
         HoodieMetadataPayload payload = record.getData();
-        String recordKey = payload.getRecordKeyFromSecondaryIndex();
-        if (keySet.contains(recordKey)) {
-          logRecordsMap.put(recordKey, record);
+        if (!payload.isDeleted()) { // process only valid records.
+          String recordKey = payload.getRecordKeyFromSecondaryIndex();
+          if (keySet.contains(recordKey)) {
+            logRecordsMap.put(recordKey, record);
+          }
+        } else {
+          deletedRecordsFromLogs.add(record.getRecordKey());

Review Comment:
   yes, I too had the same question for @codope. do we have an answer to that. 
if not, can you file a follow up ticket. 



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