shangxinli commented on code in PR #20346:
URL: https://github.com/apache/hudi/pull/20346#discussion_r4289842978


##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -701,6 +701,12 @@ public static void create(HoodieStorage storage, 
StoragePath metadataFolder, Pro
         hoodieConfig.setValue(POPULATE_META_FIELDS,
             Boolean.toString(metaFieldsMode.toLegacyPopulateMetaFields()));
       }
+      List<String> orderingFields = 
StringUtils.split(hoodieConfig.getProps().getProperty(ORDERING_FIELDS.key()), 
",");
+      if (orderingFields.size() == 1 && 
tableVersion.lesserThan(HoodieTableVersion.NINE)) {
+        // readers of tables below version 9 only know the deprecated 
precombine key, which the 9 to 8 downgrade writes too,
+        // and take its value as one field name
+        hoodieConfig.setValue(PRECOMBINE_FIELD, orderingFields.get(0));

Review Comment:
   **major:** `NineToEightDowngradeHandler.getOrderingFieldsBelowVersionNine` 
in #20348 resolves this to `DebeziumConstants.ADDED_SEQ_COL_NAME` when the 
legacy payload is `MySqlDebeziumAvroPayload`, so a v8 table created here and an 
identical one downgraded to v8 end up with different precombine keys. 
`LEGACY_PAYLOAD_CLASS_NAME` is reconciled before this point, so the same check 
fits 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