wombatu-kun commented on code in PR #20348:
URL: https://github.com/apache/hudi/pull/20348#discussion_r4305380720
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/NineToEightDowngradeHandler.java:
##########
@@ -138,12 +143,37 @@ private void reconcileMergeConfigs(Map<ConfigProperty,
String> propertiesToAdd,
private void reconcileOrderingFieldsConfig(Map<ConfigProperty, String>
propertiesToAdd,
Set<ConfigProperty>
propertiesToRemove,
HoodieTableConfig tableConfig) {
- Option<String> orderingFieldsOpt =
MySqlDebeziumAvroPayload.class.getName().equals(tableConfig.getLegacyPayloadClass())
- ? Option.of(DebeziumConstants.ADDED_SEQ_COL_NAME)
- : tableConfig.getOrderingFieldsStr();
- orderingFieldsOpt.ifPresent(orderingFields -> {
- propertiesToAdd.put(HoodieTableConfig.PRECOMBINE_FIELD, orderingFields);
+ List<String> orderingFields =
getOrderingFieldsBelowVersionNine(tableConfig);
+ if (orderingFields.size() == 1) {
+ // the parsed field, so that a stray separator as in `ts,` does not end
up in a key read as one field name
Review Comment:
Done aef75ce3c4e9
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/NineToEightDowngradeHandler.java:
##########
@@ -78,6 +82,7 @@ public UpgradeDowngrade.TableConfigChangeSet
downgrade(HoodieWriteConfig config,
SupportsUpgradeDowngrade upgradeDowngradeHelper) {
final HoodieTable table = upgradeDowngradeHelper.getTable(config, context);
HoodieTableMetaClient metaClient = table.getMetaClient();
+ validateOrderingFields(metaClient.getTableConfig(),
HoodieTableVersion.EIGHT);
Review Comment:
Done aef75ce3c4e9. Only `UpgradeDowngrade.run` checks now, so a 10 to 6
request reports version 6, which `TestUpgradeDowngradeOrchestration` now covers.
--
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]