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


##########
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java:
##########
@@ -63,6 +62,15 @@ public abstract class ViewCatalogTests<C extends ViewCatalog 
& SupportsNamespace
 
   @TempDir private Path tempDir;
 
+  protected String viewLocation(String... paths) {
+    String location = tempDir.toFile().toURI().toString();
+    location = location.substring(0, location.length() - 1);

Review Comment:
   we can't just blindly strip the last character. I think what you want to do 
here is to strip the last "/". For that you'd want to use 
`LocationUtil.stripTrailingSlash`:
   
   ```
   protected String viewLocation(String... paths) {
       StringBuilder location =
           new 
StringBuilder(LocationUtil.stripTrailingSlash(tempDir.toFile().toURI().toString()));
       for (String path : paths) {
         location.append("/").append(path);
       }
   
       return location.toString();
     }
   ```



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