This is an automated email from the ASF dual-hosted git repository.
sivabalan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new f0a73bd5985 [MINOR] Avoiding to ingest update records to RLI (#9675)
f0a73bd5985 is described below
commit f0a73bd598585fa3f40e3ee239275e14f5179af1
Author: Sivabalan Narayanan <[email protected]>
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());