danny0405 commented on code in PR #11943:
URL: https://github.com/apache/hudi/pull/11943#discussion_r1855723822


##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -684,21 +676,110 @@ public void setInitialVersion(HoodieTableVersion 
initialVersion) {
   }
 
   public RecordMergeMode getRecordMergeMode() {
-    return 
RecordMergeMode.valueOf(getStringOrDefault(RECORD_MERGE_MODE).toUpperCase());
+    return RecordMergeMode.getValue(getStringOrDefault(RECORD_MERGE_MODE));
   }
 
   /**
    * Read the payload class for HoodieRecords from the table properties.
    */
   public String getPayloadClass() {
-    return RecordPayloadType.getPayloadClassName(this);
+    return HoodieRecordPayload.getPayloadClassName(this);
+  }
+
+  public String getRecordMergeStrategyId() {
+    return getString(RECORD_MERGE_STRATEGY_ID);
   }
 
   /**
-   * Read the payload class for HoodieRecords from the table properties.
+   * Infers the merging behavior based on what the user sets (or doesn't set).
+   * Validates that the user has not set an illegal combination of configs
    */
-  public String getRecordMergerStrategy() {
-    return getStringOrDefault(RECORD_MERGER_STRATEGY);
+  public static Triple<RecordMergeMode, String, String> 
inferCorrectMergingBehavior(RecordMergeMode recordMergeMode, String 
payloadClassName,
+                                                                               
     String recordMergeStrategyId) {

Review Comment:
   Can the logic here be more cleaner? It looks like a mess.



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