sreejasahithi commented on code in PR #10187:
URL: https://github.com/apache/ozone/pull/10187#discussion_r3187617204


##########
hadoop-ozone/iceberg/src/main/java/org/apache/hadoop/ozone/iceberg/RewriteTablePathOzoneAction.java:
##########
@@ -241,7 +249,7 @@ private Set<Pair<String, String>> 
rewriteVersionFile(TableMetadata metadata, Str
     Set<Pair<String, String>> result = new HashSet<>();
     String stagingPath = RewriteTablePathUtil.stagingPath(versionFilePath, 
sourcePrefix, stagingDir);
     
-    System.out.println("Processing version file " + versionFilePath);
+    LOG.info("Processing version file {}", versionFilePath);

Review Comment:
   LOG.info will cause noise in the command output with the additional 
information as follows
   ```
   2026-05-05 12:00:01,000 [main] INFO RewriteTablePathOzoneAction: Processing 
version file v4.metadata.json
   2026-05-05 12:00:01,050 [main] INFO RewriteTablePathOzoneAction: Processing 
version file v3.metadata.json
   ```



##########
hadoop-ozone/iceberg/src/test/java/org/apache/hadoop/ozone/iceberg/TestRewriteTablePathOzoneAction.java:
##########
@@ -188,6 +189,51 @@ void tablePathRewriteForStartAndEndVersionProvided() 
throws Exception {
     assertAllInternalPathsRewritten(csvPairs, targetPrefix);
   }
 
+  @Test
+  void executeRejectsMissingLocationPrefix() {
+    NullPointerException exception = assertThrows(NullPointerException.class,
+        () -> new RewriteTablePathOzoneAction(table)
+            .stagingLocation(stagingDir.toString() + "/")
+            .execute());
+
+    assertEquals("Source prefix is null", exception.getMessage());
+  }

Review Comment:
   This does not need to be checked because when we add the CLI 
[HDDS-14946](https://issues.apache.org/jira/browse/HDDS-14946) the source and 
target prefix would be required fields so they can not be missing. 
   And once the CLI is added , the source and target prefix will be set before 
calling the action.
   rewriteLocationPrefix is always called by the CLI before execute(), then 
sourcePrefix will never be null in practice, and the test adds no real value to 
it.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to