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


##########
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java:
##########
@@ -63,6 +63,14 @@ public abstract class ViewCatalogTests<C extends ViewCatalog 
& SupportsNamespace
 
   @TempDir private Path tempDir;
 
+  protected String baseViewLocation(TableIdentifier identifier) {
+    String base = tempDir.toFile().toURI().toString();

Review Comment:
   I had to fall back to `tempDir.toFile().toURI().toString();`
   Or we could use `toUri().toURL().toString()`
   
   Something normalizes the path inside the catalog, and this line provides the 
path for both the expected and actual location.
   ```
   toUri().toString():          
file:///var/folders/zj/0jt33nqd5c9dnjg5mzpxyhpr0000gn/T/junit5905748021607238830/
   toFile().toURI().toString(): 
file:/var/folders/zj/0jt33nqd5c9dnjg5mzpxyhpr0000gn/T/junit5905748021607238830/
   ```
   
   Causes test fails like:
   ```
    TestNessieViewCatalog [V2] > createViewWithCustomMetadataLocation() [V2] 
FAILED
       java.lang.AssertionError: 
       Expecting actual:
         
"file:/var/folders/zj/0jt33nqd5c9dnjg5mzpxyhpr0000gn/T/junit-12884447435232515307/custom-location/00000-6294192f-073a-4ea1-9421-0223cd619d55.gz.metadata.json"
       to start with:
         
"file:///var/folders/zj/0jt33nqd5c9dnjg5mzpxyhpr0000gn/T/junit-12884447435232515307/custom-location"
           at 
org.apache.iceberg.view.ViewCatalogTests.createViewWithCustomMetadataLocation(ViewCatalogTests.java:369)
           at java.base/java.lang.reflect.Method.invoke(Method.java:580)
   ```



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