xushiyan commented on a change in pull request #1793:
URL: https://github.com/apache/hudi/pull/1793#discussion_r449819653
##########
File path:
hudi-client/src/main/java/org/apache/hudi/index/bloom/HoodieGlobalBloomIndex.java
##########
@@ -125,6 +125,9 @@ public HoodieGlobalBloomIndex(HoodieWriteConfig config) {
// Create an empty record to delete the record in the old partition
HoodieRecord<T> emptyRecord = new
HoodieRecord(recordLocationHoodieKeyPair.get()._2,
new EmptyHoodieRecordPayload());
+ emptyRecord.unseal();
+
emptyRecord.setCurrentLocation(recordLocationHoodieKeyPair.get()._1());
+ emptyRecord.seal();
Review comment:
It seems that we don't need to unseal() as the sealed is `false` when
using
https://github.com/apache/hudi/blob/574dcf920c4677513f6fdc8d441bb42827afa5a2/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java#L67-L73
##########
File path:
hudi-client/src/main/java/org/apache/hudi/index/simple/HoodieGlobalSimpleIndex.java
##########
@@ -131,6 +131,9 @@ public HoodieGlobalSimpleIndex(HoodieWriteConfig config) {
if (config.getGlobalSimpleIndexUpdatePartitionPath() &&
!(inputRecord.getPartitionPath().equals(partitionPath))) {
// Create an empty record to delete the record in the old
partition
HoodieRecord<T> emptyRecord = new HoodieRecord(new
HoodieKey(inputRecord.getRecordKey(), partitionPath), new
EmptyHoodieRecordPayload());
+ emptyRecord.unseal();
+ emptyRecord.setCurrentLocation(location);
+ emptyRecord.seal();
Review comment:
ditto
##########
File path:
hudi-client/src/test/java/org/apache/hudi/client/TestHoodieClientOnCopyOnWriteStorage.java
##########
@@ -399,56 +405,173 @@ public void testDeletes() throws Exception {
}
/**
- * Test update of a record to different partition with Global Index.
+ * Tests when update partition path is set in global bloom, existing record
in old partition
+ * is deleted appropriately.
+ * @throws Exception
Review comment:
minor: `@throws Exception` looks redundant without further info
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]