ebyhr commented on code in PR #18304:
URL: https://github.com/apache/iceberg/pull/18304#discussion_r4226173247
##########
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("://");
+ if (schemeEnd >= 0) {
+ int authorityEnd = path.indexOf('/', schemeEnd + 3);
+ path = authorityEnd < 0 ? "" : path.substring(authorityEnd);
+ }
+
+ if (path.isEmpty()) {
+ return "";
Review Comment:
Yeah, this line is meant to preserve existing behavior. I can't find a
compelling reason to retain it. Updated.
--
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]