rdblue commented on code in PR #18304:
URL: https://github.com/apache/iceberg/pull/18304#discussion_r4223301915


##########
core/src/main/java/org/apache/iceberg/LocationProviders.java:
##########
@@ -198,14 +197,29 @@ public String newDataLocation(String filename) {
     }
 
     private static String pathContext(String tableLocation) {
-      Path dataPath = new Path(tableLocation);
-      Path parent = dataPath.getParent();
+      // strip the scheme and authority (e.g. "s3://bucket") so only path 
segments remain
+      String path = tableLocation;
+      int schemeEnd = path.indexOf("://");

Review Comment:
   I don't think this is quite correct. The `:` is associated with the scheme. 
Authority begins with `//` if it is present. Authority may also be empty, as in 
`file:///`.
   
   I would start by borrowing some of the logic from `LocationUtil` for 
detecting a scheme. Also, is it possible to start from the end of the string 
and work backward?



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