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


##########
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 don't think so, it's very hard to keep the logic int consistency because 
they are scatered all around, such code are likely to incur new bugs.



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