rahil-c commented on code in PR #13642:
URL: https://github.com/apache/hudi/pull/13642#discussion_r2255010084
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngrade.java:
##########
@@ -130,6 +145,25 @@ public boolean needsUpgrade(HoodieTableVersion
toWriteVersion) {
* @param instantTime current instant time that should not be touched.
*/
public void run(HoodieTableVersion toVersion, String instantTime) {
+ // Fetch version from property file and current version
+ HoodieTableVersion fromVersion =
metaClient.getTableConfig().getTableVersion();
+ // Determine if we are upgrading or downgrading
+ boolean isUpgrade = fromVersion.versionCode() < toVersion.versionCode();
+ if (isUpgrade && !config.autoUpgrade()) {
+ // if we are attempting to upgrade and auto-upgrade is disabled
+ // we set the write config table version to bounded by the current hudi
table version
+ // and then exit out the upgrade process
+ LOG.warn("AUTO_UPGRADE_VERSION was explicitly disabled, skipping table
version upgrade process");
Review Comment:
@linliu-code I assume manual upgrade would be someone using the
upgrade/downgrade command themselves from the cli as a one time operation, vs
autoUpgrade is a behavior that writers will adhere to if they see a table
version lower than the write version and try to bring the table version up.
I also agree the naming is confusing but wondering if we can maybe take this
up in a separate patch?
--
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]