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


##########
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:
   The TWO-to-FIVE upgrade covers each upgrade step (2 to 3, 3 to 4, and 4 to 
5) so the supported upgrading logic is covered.



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