yihua commented on code in PR #13615:
URL: https://github.com/apache/hudi/pull/13615#discussion_r2277733702


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieWriterUtils.scala:
##########
@@ -216,6 +217,34 @@ object HoodieWriterUtils {
     validateTableConfig(spark, params, tableConfig, false)
   }
 
+  /**
+   * This function adds specific rules to choose the right config key for 
payload class for version 9 tables.
+   *
+   * RULE 1: When
+   *   1. table version is 9,
+   *   2. writer key is a payload class key, and
+   *   3. table config has legacy payload class configured,
+   * then
+   *   return legacy payload class key.
+   *
+   * Basic rule:
+   *   return writer key.
+   */
+  def getPayloadClassConfigKeyFromTableConfig(key: String, tableConfig: 
HoodieConfig): String = {

Review Comment:
   Fixed now



##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestPayloadDeprecationFlow.scala:
##########
@@ -59,15 +61,30 @@ class TestPayloadDeprecationFlow extends 
SparkClientFunctionalTestHarness {
       options(opts).
       mode(SaveMode.Overwrite).
       save(basePath)
+    // Verify table was created successfully
+    val metaClient = HoodieTableMetaClient.builder()
+      .setBasePath(basePath)
+      .setConf(storageConf())
+      .build()
+    val tableConfig = metaClient.getTableConfig
+    // Verify table version is 9
+    assertEquals(9, tableConfig.getTableVersion.versionCode())
+    // Verify expected configs are set correctly
+    expectedConfigs.foreach { case (key, expectedValue) =>
+      if (expectedValue != null) {
+        assertEquals(expectedValue, tableConfig.getString(key), s"Config $key 
should be $expectedValue")
+      } else {
+        assertFalse(tableConfig.contains(key), s"Config $key should not be 
present")
+      }
+    }
     // 2. Add an update.
     val firstUpdateData = Seq(
-      (11, "1", "rider-X", "driver-X", 19.10, "d"),
+      (11, "1", "rider-X", "driver-X", 19.10, "D"),

Review Comment:
   HUDI-9718 to fix



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