flyrain commented on code in PR #505:
URL: https://github.com/apache/polaris/pull/505#discussion_r1870381996


##########
polaris-core/src/main/java/org/apache/polaris/core/storage/StorageLocation.java:
##########
@@ -39,8 +40,8 @@ public static StorageLocation of(String location) {
   protected StorageLocation(@Nonnull String location) {
     if (location == null) {
       this.location = null;
-    } else if (location.startsWith("file:/") && 
!location.startsWith("file:///")) {
-      this.location = URI.create(location.replaceFirst("file:/+", 
"file:///")).toString();
+    } else if (location.startsWith("file:/") && 
!location.startsWith(LOCAL_PATH_PREFIX)) {
+      this.location = URI.create(location.replaceFirst("file:/+", 
LOCAL_PATH_PREFIX)).toString();

Review Comment:
   Can we normalized the location here so that no change is needed in method 
`isChildOf()`?  We can do that as the following:
   ```
   } else if (location.startsWith("/") ) {
         this.location = URI.create(location.replaceFirst("/+", 
LOCAL_PATH_PREFIX)).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]

Reply via email to