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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -871,16 +892,29 @@ public static Triple<RecordMergeMode, String, String> 
inferCorrectMergingBehavio
     return Triple.of(inferredRecordMergeMode, inferredPayloadClassName, 
inferredRecordMergeStrategyId);
   }
 
-  public static RecordMergeMode inferRecordMergeModeFromPayloadClass(String 
payloadClassName) {
+  public static RecordMergeMode inferRecordMergeModeFromPayloadClass(String 
payloadClassName, HoodieTableVersion tableVersion) {
     if (isNullOrEmpty(payloadClassName)) {
       return null;
     }
-    if (DefaultHoodieRecordPayload.class.getName().equals(payloadClassName)
-        || EventTimeAvroPayload.class.getName().equals(payloadClassName)) {
-      // DefaultHoodieRecordPayload and EventTimeAvroPayload match with 
EVENT_TIME_ORDERING.
+    // Special handling for table version 9.
+    // Due to HUDI RFC-97, more payload classes are mapped to merge mode in 
table version 9.
+    // Currently the table version 9 is not added yet, so we use >= 8 
temporarily.
+    // TODO: We need to change comparison to == 9, instead of >= 8 when tablee 
version 9 has been enabled.
+    if (tableVersion.versionCode() >= HoodieTableVersion.EIGHT.versionCode()) {
+      if (PartialUpdateAvroPayload.class.getName().equals(payloadClassName)
+          || 
PostgresDebeziumAvroPayload.class.getName().equals(payloadClassName)
+          || EventTimeAvroPayload.class.getName().equals(payloadClassName)) {
+        return EVENT_TIME_ORDERING;
+      } else if 
(OverwriteNonDefaultsWithLatestAvroPayload.class.getName().equals(payloadClassName)
+              || AWSDmsAvroPayload.class.getName().equals(payloadClassName)) {
+        return COMMIT_TIME_ORDERING;
+      }
+    }
+
+    // For general case.

Review Comment:
   can we combine the general case with the above logic? why split into two 
parts?



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