bvaradar commented on code in PR #12327:
URL: https://github.com/apache/hudi/pull/12327#discussion_r1861256388
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/SevenToEightUpgradeHandler.java:
##########
@@ -62,19 +78,38 @@ public class SevenToEightUpgradeHandler implements
UpgradeHandler {
@Override
public Map<ConfigProperty, String> upgrade(HoodieWriteConfig config,
HoodieEngineContext context,
String instantTime,
SupportsUpgradeDowngrade upgradeDowngradeHelper) {
+ Map<ConfigProperty, String> tablePropsToAdd = new HashMap<>();
HoodieTable table = upgradeDowngradeHelper.getTable(config, context);
HoodieTableMetaClient metaClient = table.getMetaClient();
HoodieTableConfig tableConfig = metaClient.getTableConfig();
+ // If auto upgrade is disabled, set initial version and writer version to
6 and return
+ if (!config.autoUpgrade()) {
+ setInitialVersion(config, table.getMetaClient().getTableConfig(),
tablePropsToAdd);
Review Comment:
why do we need to set initial version in this case ? AFAIK, Initial version
is not used to determine behavior
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/SevenToEightUpgradeHandler.java:
##########
@@ -62,19 +78,38 @@ public class SevenToEightUpgradeHandler implements
UpgradeHandler {
@Override
public Map<ConfigProperty, String> upgrade(HoodieWriteConfig config,
HoodieEngineContext context,
String instantTime,
SupportsUpgradeDowngrade upgradeDowngradeHelper) {
+ Map<ConfigProperty, String> tablePropsToAdd = new HashMap<>();
HoodieTable table = upgradeDowngradeHelper.getTable(config, context);
HoodieTableMetaClient metaClient = table.getMetaClient();
HoodieTableConfig tableConfig = metaClient.getTableConfig();
+ // If auto upgrade is disabled, set initial version and writer version to
6 and return
+ if (!config.autoUpgrade()) {
+ setInitialVersion(config, table.getMetaClient().getTableConfig(),
tablePropsToAdd);
+ config.setValue(HoodieWriteConfig.WRITE_TABLE_VERSION,
String.valueOf(HoodieTableVersion.SIX.versionCode()));
Review Comment:
So, the expectation is that subsequent operations after upgrade needs to use
the same WriteConfig ?
By default autoUpgrade is on and it will be turned off when user doesn't
want upgrade to run. In this case, why do we would the case arise ?
Wouldn't this step
(https://github.com/apache/hudi/blob/aa0f57c60361a7c03ec99da56c2264452f89927d/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngrade.java#L64
) avoid this case 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]