Skip to content

Commit 93dc680

Browse files
fix: minor fix
1 parent 7a5408a commit 93dc680

2 files changed

Lines changed: 4 additions & 24 deletions

File tree

amoro-format-iceberg/src/main/java/org/apache/amoro/aws/StaticAwsCredentialsProvider.java

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,9 @@
2727
import java.util.Map;
2828

2929
/**
30-
* A static AWS credentials provider that can be instantiated by Iceberg's {@link
31-
* org.apache.iceberg.aws.AwsClientProperties} via the {@code create(Map)} reflection mechanism.
32-
*
33-
* <p>When configured as {@code client.credentials-provider}, Iceberg strips the {@code
34-
* client.credentials-provider.} prefix from sub-properties and passes the remaining map to {@link
35-
* #create(Map)}. This provider reads the following keys from that map:
36-
*
37-
* <ul>
38-
* <li>{@code access-key-id} — AWS access key ID
39-
* <li>{@code secret-access-key} — AWS secret access key
40-
* </ul>
41-
*
42-
* <p>This is needed because the Iceberg Glue client does not read S3-specific credential properties
43-
* ({@code s3.access-key-id} / {@code s3.secret-access-key}). Without this provider, the Glue client
44-
* falls back to the default AWS credential chain, which may not have valid credentials.
30+
* This is needed because the Iceberg Glue client does not read S3-specific credential properties
31+
* (s3.access-key-id / s3.secret-access-key). Without this provider, the Glue client falls back to
32+
* the default AWS credential chain, which may not have valid credentials.
4533
*/
4634
public class StaticAwsCredentialsProvider implements AwsCredentialsProvider {
4735

@@ -54,15 +42,6 @@ private StaticAwsCredentialsProvider(String accessKeyId, String secretAccessKey)
5442
this.credentials = AwsBasicCredentials.create(accessKeyId, secretAccessKey);
5543
}
5644

57-
/**
58-
* Called by Iceberg via reflection when {@code client.credentials-provider} is set to this
59-
* class's fully qualified name. The properties map contains sub-properties under the {@code
60-
* client.credentials-provider.} prefix (with the prefix stripped).
61-
*
62-
* @param properties map containing {@code access-key-id} and {@code secret-access-key}
63-
* @return an {@link AwsCredentialsProvider} using the provided static credentials
64-
* @throws IllegalArgumentException if either key is missing
65-
*/
6645
public static AwsCredentialsProvider create(Map<String, String> properties) {
6746
String accessKeyId = properties.get(ACCESS_KEY_ID);
6847
String secretAccessKey = properties.get(SECRET_ACCESS_KEY);

amoro-format-iceberg/src/main/java/org/apache/amoro/formats/iceberg/IcebergCatalogFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public FormatCatalog create(
4747
MixedFormatCatalogUtil.withIcebergCatalogInitializeProperties(
4848
name, metastoreType, properties);
4949

50+
// Setting the StaticAwsCredentialsProvider for Glue catalog to read the S3 credentials
5051
if (CatalogMetaProperties.CATALOG_TYPE_GLUE.equalsIgnoreCase(metastoreType)) {
5152
Map<String, String> newProperties = Maps.newHashMap(properties);
5253
String accessKey = newProperties.get(S3FileIOProperties.ACCESS_KEY_ID);

0 commit comments

Comments
 (0)