tomtongue commented on code in PR #6352: URL: https://github.com/apache/iceberg/pull/6352#discussion_r1045017558
########## aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java: ########## @@ -74,17 +74,14 @@ class S3URI { this.scheme = schemeSplit[0]; String[] authoritySplit = schemeSplit[1].split(PATH_DELIM, 2); - ValidationException.check( - authoritySplit.length == 2, "Invalid S3 URI, cannot determine bucket: %s", location); - ValidationException.check( - !authoritySplit[1].trim().isEmpty(), "Invalid S3 URI, path is empty: %s", location); + this.bucket = bucketToAccessPointMapping == null ? authoritySplit[0] : bucketToAccessPointMapping.getOrDefault(authoritySplit[0], authoritySplit[0]); // Strip query and fragment if they exist - String path = authoritySplit[1]; + String path = authoritySplit.length > 1 ? authoritySplit[1] : ""; Review Comment: This line allows both no-key/path and with key/path patterns (If i misunderstand your comment, please let me know). `authoritySplit[1]` is basically used in this pattern. However, if users specify an only s3 bucket name, the length of `authrogithSplit` is `1`, then it sets an empty String (not possible to specify `null` because s3requester doesn't allow to set `null` for its key). -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org