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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -268,6 +268,7 @@ public class HoodieTableConfig extends HoodieConfig {
       .defaultValue((RecordMergeMode) null,
           "COMMIT_TIME_ORDERING if ordering field is not set; 
EVENT_TIME_ORDERING if ordering field is set")
       .sinceVersion("1.0.0")
+      .withAlternatives("hoodie.write.record.merge.mode")

Review Comment:
   I don't think we wanted to add alternatives here. writer properties and 
table properties for some of the configs are intentionally kept separately. 
   



##########
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:
   all 3 tests can be folded into 1 w/ parametrized



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