yjc408 commented on code in PR #13831:
URL: https://github.com/apache/hudi/pull/13831#discussion_r2331407902


##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/deltastreamer/TestHoodieDeltaStreamer.java:
##########
@@ -1886,7 +1886,56 @@ public void testPartialPayloadClass() throws Exception {
     assertEquals(metaClient.getTableConfig().getPayloadClass(), 
DefaultHoodieRecordPayload.class.getName());
   }
 
-  @Disabled("To be fixed with HUDI-9714")
+  @Test
+  public void testMergeModeUpdate() throws Exception {
+    String dataSetBasePath = basePath + "/test_dataset_mor_merge_mode_update";
+    HoodieDeltaStreamer.Config cfg = TestHelpers.makeConfig(dataSetBasePath, 
WriteOperationType.BULK_INSERT,
+        Collections.singletonList(SqlQueryBasedTransformer.class.getName()), 
PROPS_FILENAME_TEST_SOURCE, false,
+        true, false, null, "MERGE_ON_READ");
+    new HoodieDeltaStreamer(cfg, jsc, fs, hiveServer.getHiveConf()).sync();
+    assertRecordCount(1000, dataSetBasePath, sqlContext);
+    HoodieTableMetaClient metaClient = UtilHelpers.createMetaClient(jsc, 
dataSetBasePath, false);
+    assertEquals(metaClient.getTableConfig().getPayloadClass(), 
DefaultHoodieRecordPayload.class.getName());
+
+    //now create one more deltaStreamer instance and update payload class
+    HoodieDeltaStreamer.Config updatedConfig = 
TestHelpers.makeConfig(dataSetBasePath, WriteOperationType.BULK_INSERT,
+        Collections.singletonList(SqlQueryBasedTransformer.class.getName()), 
PROPS_FILENAME_TEST_SOURCE, false,
+        true, false, null, "MERGE_ON_READ");
+    updatedConfig.recordMergeMode = RecordMergeMode.CUSTOM;
+    updatedConfig.recordMergeStrategyId = 
HoodieRecordMerger.CUSTOM_MERGE_STRATEGY_UUID;
+    Exception e = assertThrows(HoodieException.class, () -> {
+      new HoodieDeltaStreamer(updatedConfig, jsc, fs, 
hiveServer.getHiveConf());
+    }, "Should error out when merge mode is switched");
+    assertTrue(e.getMessage().contains("Config conflict(key"));
+    
assertTrue(e.getMessage().contains(HoodieTableConfig.RECORD_MERGE_MODE.key()));
+  }
+
+  @Test
+  public void testMergeStrategyIdUpdate() throws Exception {

Review Comment:
   added as a parameterized test. 



-- 
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]

Reply via email to