linliu-code commented on code in PR #12327:
URL: https://github.com/apache/hudi/pull/12327#discussion_r1861107801
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/EightToSevenDowngradeHandler.java:
##########
@@ -168,6 +156,168 @@ private static void
downgradePartitionFields(HoodieWriteConfig config,
}
}
+ static void unsetInitialVersion(HoodieTableConfig tableConfig,
Map<ConfigProperty, String> tablePropsToAdd) {
+ tableConfig.getProps().remove(HoodieTableConfig.INITIAL_VERSION.key());
+ }
+
+ static void unsetRecordMergeMode(HoodieTableConfig tableConfig,
Map<ConfigProperty, String> tablePropsToAdd) {
+ Triple<RecordMergeMode, String, String> mergingConfigs =
+
HoodieTableConfig.inferCorrectMergingBehavior(tableConfig.getRecordMergeMode(),
tableConfig.getPayloadClass(), tableConfig.getRecordMergeStrategyId());
+ if (StringUtils.nonEmpty(mergingConfigs.getMiddle())) {
+ tablePropsToAdd.put(HoodieTableConfig.PAYLOAD_CLASS_NAME,
mergingConfigs.getMiddle());
+ }
+ if (StringUtils.nonEmpty(mergingConfigs.getRight())) {
+ tablePropsToAdd.put(HoodieTableConfig.RECORD_MERGE_STRATEGY_ID,
mergingConfigs.getRight());
+ }
+ tableConfig.getProps().remove(HoodieTableConfig.RECORD_MERGE_MODE.key());
+ }
Review Comment:
I know the merge_mode should be removed. If we don't add payload and
strategy id into the `tablePropsToAdd`, will they be kept in version 7 table
config? I try to figure out why do we need to add them into `tablePropsToAdd`.
--
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]