nastra commented on code in PR #13216: URL: https://github.com/apache/iceberg/pull/13216#discussion_r2126216911
########## aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIO.java: ########## @@ -623,6 +662,73 @@ public void testInputFileWithManifest() throws IOException { verify(s3mock, never()).headObject(any(HeadObjectRequest.class)); } + @Test + public void resolvingFileIOLoadWithoutStorageCredentials() + throws IOException, ClassNotFoundException { + ResolvingFileIO resolvingFileIO = new ResolvingFileIO(); + resolvingFileIO.initialize(ImmutableMap.of(AwsClientProperties.CLIENT_REGION, "us-east-1")); + + FileIO result = + DynMethods.builder("io") + .hiddenImpl(ResolvingFileIO.class, String.class) + .build(resolvingFileIO) + .invoke("s3://foo/bar"); + assertThat(result) + .isInstanceOf(S3FileIO.class) + .asInstanceOf(InstanceOfAssertFactories.type(S3FileIO.class)) + .satisfies( + fileIO -> { + assertThat(fileIO.client("s3://foo/bar")) + .isSameAs(fileIO.client()) + .isInstanceOf(S3Client.class); + assertThat(fileIO.asyncClient("s3://foo/bar")) + .isSameAs(fileIO.asyncClient()) + .isInstanceOf(S3AsyncClient.class); + }); + + // make sure credentials can be accessed after kryo serde + ResolvingFileIO resolvingIO = TestHelpers.KryoHelpers.roundTripSerialize(resolvingFileIO); Review Comment: yes that might make sense. We do have the same issue across the codebase so I've opened https://github.com/apache/iceberg/issues/13237 to address this -- 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