codope commented on code in PR #12105:
URL: https://github.com/apache/hudi/pull/12105#discussion_r1816467881
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -931,17 +940,22 @@ private Map<String,
List<HoodieRecord<HoodieMetadataPayload>>> lookupSecondaryKe
List<String> sortedSecondaryKeys = new ArrayList<>(secondaryKeys);
secondaryKeySet.addAll(sortedSecondaryKeys);
Collections.sort(sortedSecondaryKeys);
+ Set<String> deletedRecordKeysFromLogs = new HashSet<>();
logRecordScanner.getRecords().forEach(record -> {
HoodieMetadataPayload payload = record.getData();
- String secondaryKey = payload.key;
- if (secondaryKeySet.contains(secondaryKey)) {
- String recordKey = payload.getRecordKeyFromSecondaryIndex();
- logRecordsMap.computeIfAbsent(secondaryKey, k -> new
HashMap<>()).put(recordKey, record);
+ if (!payload.isDeleted()) {
+ String secondaryKey = payload.key;
Review Comment:
Yes, this can be refactored. We need to move this logic inside
`HoodieMetadataPayload.combineSecondaryIndexRecord`, and need to override
`MetadataPartitionType.combineMetadataPayloads` for secondary index. Followup -
HUDI-8436
--
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]