You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2024/11/25 03:28:44 UTC
Re: [PR] [HUDI-8203] Make record merge mode the primary merging config [hudi]
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org