nsivabalan commented on code in PR #6374:
URL: https://github.com/apache/hudi/pull/6374#discussion_r945832105


##########
hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestUpgradeDowngradeCommand.java:
##########
@@ -83,10 +88,32 @@ public void init() throws Exception {
         .withMarkerFile(DEFAULT_THIRD_PARTITION_PATH, "file-3", IOType.MERGE);
   }
 
-  @Test
-  public void testDowngradeCommand() throws Exception {
-    // update hoodie.table.version to 1
-    metaClient.getTableConfig().setTableVersion(HoodieTableVersion.ONE);
+  @AfterEach
+  public void cleanup() {
+    if (timelineService != null) {
+      timelineService.close();
+    }
+  }
+
+  private static Stream<Arguments> testArgsForUpgradeDowngradeCommand() {
+    return Arrays.stream(new HoodieTableVersion[][] {
+        {HoodieTableVersion.FIVE, HoodieTableVersion.ZERO},
+        {HoodieTableVersion.ZERO, HoodieTableVersion.ONE},
+        // Table upgrade from version ONE to TWO requires key generator 
related configs
+        // such as "hoodie.datasource.write.recordkey.field" which is only 
available
+        // when user configures the write job.  So the table upgrade from 
version ONE to TWO
+        // through CLI is not supported, and user should rely on the automatic 
upgrade
+        // in the write client instead.
+        // {HoodieTableVersion.ONE, HoodieTableVersion.TWO},
+        {HoodieTableVersion.TWO, HoodieTableVersion.FIVE}

Review Comment:
   curious: why we did not add all possible upgrade and downgrade combinations 
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]

Reply via email to