singhpk234 commented on code in PR #18765:
URL: https://github.com/apache/iceberg/pull/18765#discussion_r4749571008
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -337,6 +337,7 @@ public Iterable<FileInfo> listPrefix(String prefix) {
}
S3URI s3uri = uri;
+ String bucket = new S3URI(prefix).bucket();
Review Comment:
also name this as rawBucketName or something ?
##########
aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIO.java:
##########
@@ -291,6 +291,22 @@ public void testPrefixList() {
assertThat(Streams.stream(s3FileIO.listPrefix(prefix)).count()).isEqualTo(totalFiles);
}
+ @Test
+ public void prefixListWithAccessPointReturnsBucketLocations() throws
IOException {
+ String accessPoint = "access-point";
+ createBucket(accessPoint);
+ S3FileIO accessPointFileIO = new S3FileIO(() -> s3mock);
+ accessPointFileIO.initialize(
+ ImmutableMap.of(S3FileIOProperties.ACCESS_POINTS_PREFIX + "bucket",
accessPoint));
+
+ String location = "s3://bucket/path/to/list-access-point/file.txt";
+ accessPointFileIO.newOutputFile(location).create().close();
+
+
assertThat(accessPointFileIO.listPrefix("s3://bucket/path/to/list-access-point/"))
+ .extracting(FileInfo::location)
+ .containsExactly(location);
+ }
Review Comment:
can you please confirm if you ran this with an actual s3 / aws account ?
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -337,6 +337,7 @@ public Iterable<FileInfo> listPrefix(String prefix) {
}
S3URI s3uri = uri;
+ String bucket = new S3URI(prefix).bucket();
Review Comment:
minor : can we add a comment, for this exacts the raw bucket name without
access-point override ?
--
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]