You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by pw...@apache.org on 2023/09/13 07:35:05 UTC
[hudi] 32/37: [MINOR] Avoiding to ingest update records to RLI (#9675)
This is an automated email from the ASF dual-hosted git repository.
pwason pushed a commit to branch release-0.14.0
in repository https://gitbox.apache.org/repos/asf/hudi.git
commit a03483f09c0522d7c71b673bed14f24041de7aa2
Author: Sivabalan Narayanan <n....@gmail.com>
AuthorDate: Tue Sep 12 01:59:28 2023 -0400
[MINOR] Avoiding to ingest update records to RLI (#9675)
---
.../apache/hudi/metadata/HoodieBackedTableMetadataWriter.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
index 8a930ba5972..c548bfcfeae 100644
--- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
+++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
@@ -1434,7 +1434,7 @@ public abstract class HoodieBackedTableMetadataWriter<I> implements HoodieTableM
return recordKeyDelegatePairs
.map(writeStatusRecordDelegate -> {
HoodieRecordDelegate recordDelegate = writeStatusRecordDelegate.getValue();
- HoodieRecord hoodieRecord;
+ HoodieRecord hoodieRecord = null;
Option<HoodieRecordLocation> newLocation = recordDelegate.getNewLocation();
if (newLocation.isPresent()) {
if (recordDelegate.getCurrentLocation().isPresent()) {
@@ -1448,11 +1448,12 @@ public abstract class HoodieBackedTableMetadataWriter<I> implements HoodieTableM
LOG.error(msg);
throw new HoodieMetadataException(msg);
}
+ // for updates, we can skip updating RLI partition in MDT
+ } else {
+ hoodieRecord = HoodieMetadataPayload.createRecordIndexUpdate(
+ recordDelegate.getRecordKey(), recordDelegate.getPartitionPath(),
+ newLocation.get().getFileId(), newLocation.get().getInstantTime(), dataWriteConfig.getWritesFileIdEncoding());
}
-
- hoodieRecord = HoodieMetadataPayload.createRecordIndexUpdate(
- recordDelegate.getRecordKey(), recordDelegate.getPartitionPath(),
- newLocation.get().getFileId(), newLocation.get().getInstantTime(), dataWriteConfig.getWritesFileIdEncoding());
} else {
// Delete existing index for a deleted record
hoodieRecord = HoodieMetadataPayload.createRecordIndexDelete(recordDelegate.getRecordKey());