nastra commented on code in PR #12066:
URL: https://github.com/apache/iceberg/pull/12066#discussion_r1926972454


##########
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:
##########
@@ -554,17 +549,18 @@ public static String fileName(String path) {
 
   /** Relativize a path. */
   public static String relativize(String path, String prefix) {
-    String toRemove = prefix;
-    if (!toRemove.endsWith("/")) {
-      toRemove += "/";
-    }
+    String toRemove = appendFileSeparatorIfNotExists(prefix);
     if (!path.startsWith(toRemove)) {
       throw new IllegalArgumentException(
           String.format("Path %s does not start with %s", path, toRemove));
     }
     return path.substring(toRemove.length());
   }
 
+  public static String appendFileSeparatorIfNotExists(String path) {

Review Comment:
   maybe `maybeAppendFileSeparator`?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to