codope commented on code in PR #9590:
URL: https://github.com/apache/hudi/pull/9590#discussion_r1321299763


##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -540,10 +566,17 @@ public void setTableVersion(HoodieTableVersion 
tableVersion) {
    * Read the payload class for HoodieRecords from the table properties.
    */
   public String getPayloadClass() {
-    // There could be tables written with payload class from com.uber.hoodie. 
Need to transparently
-    // change to org.apache.hudi
-    return getStringOrDefault(PAYLOAD_CLASS_NAME).replace("com.uber.hoodie",
-        "org.apache.hudi");
+    String payloadClassName;
+    if (contains(PAYLOAD_TYPE)) {
+      payloadClassName = 
RecordPayloadType.valueOf(getString(PAYLOAD_TYPE)).getClassName();
+    } else if (contains(PAYLOAD_CLASS_NAME)) {
+      payloadClassName = getString(PAYLOAD_CLASS_NAME);
+    } else {
+      payloadClassName = 
RecordPayloadType.valueOf(PAYLOAD_TYPE.defaultValue()).getClassName();
+    }

Review Comment:
   I understand your concern about code reusability but I think enums should be 
dumb. This logic depends on table config so it's better to keep here. 



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