hj2016 commented on a change in pull request #1978:
URL: https://github.com/apache/hudi/pull/1978#discussion_r484922986



##########
File path: 
hudi-client/src/test/java/org/apache/hudi/index/hbase/TestHBaseIndex.java
##########
@@ -156,6 +160,53 @@ public void testSimpleTagLocationAndUpdate() throws 
Exception {
     }
   }
 
+  @Test
+  public void testTagLocationAndPartitionPathUpdate() throws Exception {
+    final String newCommitTime = "001";
+    final int numRecords = 10;
+    final String oldPartitionPath = "1970/01/01";
+
+    // init old index to hbase
+    List<HoodieRecord> records = dataGen.generateInserts(newCommitTime, 
numRecords);
+    JavaRDD<HoodieRecord> writeRecords = jsc().parallelize(records, 1);
+    HoodieWriteConfig config = getConfig(true);
+    HBaseIndex index = new HBaseIndex(getConfig(true));
+
+    try (HoodieWriteClient writeClient = getHoodieWriteClient(config);) {
+      // allowed path change test
+      metaClient = HoodieTableMetaClient.reload(metaClient);
+      HoodieTable hoodieTable = HoodieTable.create(metaClient, config, 
hadoopConf);
+
+      JavaRDD<HoodieRecord> records1 = index.tagLocation(writeRecords, jsc(), 
hoodieTable);
+      assertEquals(0, records1.filter(record -> 
record.isCurrentLocationKnown()).count());
+      writeClient.startCommitWithTime(newCommitTime);
+      JavaRDD<WriteStatus> writeStatues = writeClient.upsert(writeRecords, 
newCommitTime);
+      writeClient.commit(newCommitTime, writeStatues);
+      assertNoWriteErrors(writeStatues.collect());
+      // mock old partition data
+      Table table = 
utility.getConnection().getTable(TableName.valueOf(TABLE_NAME));

Review comment:
        I modified it, can you confirm it?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to