diqiu50 commented on code in PR #12271:
URL: https://github.com/apache/gravitino/pull/12271#discussion_r3704136138


##########
catalogs/catalog-glue/src/test/java/org/apache/gravitino/catalog/glue/TestGlueIcebergTableHelper.java:
##########
@@ -235,4 +239,75 @@ void testLoadTableOverwritesColumnTypesFromIcebergSchema() 
{
     assertEquals(Types.TimeType.of(6), cols[1].dataType());
     assertEquals(Types.DecimalType.of(10, 2), cols[2].dataType());
   }
+
+  @Test
+  void testCreateGlueCatalogWithoutStaticCredentials() {
+    Map<String, String> config = new HashMap<>();
+    config.put(GlueConstants.AWS_REGION, "us-east-1");
+    config.put(GlueConstants.WAREHOUSE, "s3://test-bucket/warehouse");
+

Review Comment:
   The new blank-credential test doesn't actually cover the regression. 
createGlueCatalog() never threw on blank keys — the failure surfaces later in 
GravitinoGlueCredentialsProvider.resolveCredentials(). So 
testCreateGlueCatalogWithBlankStaticCredentials passes even without the fix.



##########
catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueIcebergTableHelper.java:
##########
@@ -164,7 +164,14 @@ static Catalog createGlueCatalog(Map<String, String> 
config) {
 
     String accessKey = config.get(GlueConstants.AWS_ACCESS_KEY_ID);
     String secretKey = config.get(GlueConstants.AWS_SECRET_ACCESS_KEY);
-    if (accessKey != null && secretKey != null) {
+    boolean hasAccessKey = StringUtils.isNotBlank(accessKey);
+    boolean hasSecretKey = StringUtils.isNotBlank(secretKey);
+    Preconditions.checkArgument(

Review Comment:
   We'd better make the error message is the same as GlueClientProvider



##########
catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueIcebergTableHelper.java:
##########
@@ -164,7 +164,14 @@ static Catalog createGlueCatalog(Map<String, String> 
config) {
 
     String accessKey = config.get(GlueConstants.AWS_ACCESS_KEY_ID);
     String secretKey = config.get(GlueConstants.AWS_SECRET_ACCESS_KEY);
-    if (accessKey != null && secretKey != null) {
+    boolean hasAccessKey = StringUtils.isNotBlank(accessKey);
+    boolean hasSecretKey = StringUtils.isNotBlank(secretKey);
+    Preconditions.checkArgument(

Review Comment:
   The logic is the same in GlueClientProvider, Could you consider reuse it



-- 
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]

Reply via email to