bvaradar commented on code in PR #11866:
URL: https://github.com/apache/hudi/pull/11866#discussion_r1765447834


##########
hudi-cli/src/main/java/org/apache/hudi/cli/commands/UpgradeOrDowngradeCommand.java:
##########
@@ -89,7 +89,7 @@ static String getHoodieTableVersionName(String versionOption, 
boolean overrideWi
 
     try {
       int versionCode = Integer.parseInt(versionOption);
-      return HoodieTableVersion.versionFromCode(versionCode).name();
+      return HoodieTableVersion.fromVersionCode(versionCode).name();

Review Comment:
   As we allow table service operations such as compaction to be run as part of 
downgrading (UpgradeDowngradeUtils.runCompaction), and a table could be 
downgraded to multiple versions, should we skip validating table versions in 
these cases ?



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -134,6 +135,23 @@ public class HoodieWriteConfig extends HoodieConfig {
       .noDefaultValue()
       .withDocumentation("Table name that will be used for registering with 
metastores like HMS. Needs to be same across runs.");
 
+  public static final ConfigProperty<Integer> WRITE_TABLE_VERSION = 
ConfigProperty
+      .key("hoodie.write.table.version")
+      .defaultValue(HoodieTableVersion.current().versionCode())
+      .withValidValues(
+          String.valueOf(HoodieTableVersion.SIX.versionCode()),
+          String.valueOf(HoodieTableVersion.current().versionCode())
+      )
+      .sinceVersion("1.0.0")
+      .withDocumentation("The table version this writer is storing the table 
in. This should match the current table version.");
+
+  public static final ConfigProperty<Boolean> AUTO_UPGRADE_VERSION = 
ConfigProperty
+      .key("hoodie.write.auto.upgrade")
+      .defaultValue(true)
+      .sinceVersion("1.0.0")
+      .withDocumentation("If enabled, writers automatically migrate the table 
to the specified write table version "
+          + "if the current table version is not lower.");

Review Comment:
   Should it be "if the current table version is lower"



-- 
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