This is an automated email from the ASF dual-hosted git repository.

danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dadbf9844f7 fix(config): resolve glue catalog_id key regardless of 
case (#19977)
7dadbf9844f7 is described below

commit 7dadbf9844f7f46cda19c1e0c7dc3b054bcd57ca
Author: micahsecrest <[email protected]>
AuthorDate: Thu Sep 17 01:56:11 2026 -0700

    fix(config): resolve glue catalog_id key regardless of case (#19977)
    
    Spark's DataFrameWriter and DataStreamWriter lower-case every option
    key before Hudi sees it. GLUE_CATALOG_ID used a camelCase key
    (catalogId), the only one of its kind in GlueCatalogSyncClientConfig,
    so a value set through .option() never matched and sync fell back to
    the caller's own AWS account with no warning.
    
    Rename the key to catalog_id, in line with its sibling keys, and add
    catalogId and catalogid as alternatives so both a verbatim caller and
    Spark's lower-cased path still resolve.
    
    Co-authored-by: Micah Secrest <[email protected]>
---
 .../apache/hudi/config/GlueCatalogSyncClientConfig.java    |  5 ++++-
 .../org/apache/hudi/aws/sync/TestAWSGlueSyncClient.java    | 14 ++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git 
a/hudi-aws/src/main/java/org/apache/hudi/config/GlueCatalogSyncClientConfig.java
 
b/hudi-aws/src/main/java/org/apache/hudi/config/GlueCatalogSyncClientConfig.java
index d36211e6fd6a..10aed5a89e9d 100644
--- 
a/hudi-aws/src/main/java/org/apache/hudi/config/GlueCatalogSyncClientConfig.java
+++ 
b/hudi-aws/src/main/java/org/apache/hudi/config/GlueCatalogSyncClientConfig.java
@@ -105,10 +105,13 @@ public class GlueCatalogSyncClientConfig extends 
HoodieConfig {
           + "Enabling this configuration will drop and create the table to 
match the Hoodie config");
 
   public static final ConfigProperty<String> GLUE_CATALOG_ID = ConfigProperty
-      .key(GLUE_CLIENT_PROPERTY_PREFIX + "catalogId")
+      .key(GLUE_CLIENT_PROPERTY_PREFIX + "catalog_id")
       .noDefaultValue()
       .sinceVersion("1.1.0")
       .markAdvanced()
+      .withAlternatives(
+          GLUE_CLIENT_PROPERTY_PREFIX + "catalogId",
+          GLUE_CLIENT_PROPERTY_PREFIX + "catalogid")
       .withDocumentation("The catalogId needs to be populated for syncing 
hoodie tables in a different AWS account");
 
   public static final ConfigProperty<String> GLUE_SYNC_DATABASE_NAME = 
ConfigProperty
diff --git 
a/hudi-aws/src/test/java/org/apache/hudi/aws/sync/TestAWSGlueSyncClient.java 
b/hudi-aws/src/test/java/org/apache/hudi/aws/sync/TestAWSGlueSyncClient.java
index 7e4c667f586f..81800070f2f2 100644
--- a/hudi-aws/src/test/java/org/apache/hudi/aws/sync/TestAWSGlueSyncClient.java
+++ b/hudi-aws/src/test/java/org/apache/hudi/aws/sync/TestAWSGlueSyncClient.java
@@ -326,6 +326,20 @@ class TestAWSGlueSyncClient {
     assertEquals(glueSyncProps.get(META_SYNC_BASE_PATH.key()), basePath, 
"table base path should match");
   }
 
+  @Test
+  void 
testGetCatalogId_GivenLowercaseKey_WhenReadingConfig_ThenReturnsConfiguredValue()
 {
+    // Spark's DataFrameWriter lower-cases every option key, so a config set 
via
+    // .option("hoodie.datasource.meta.sync.glue.catalogId", ...) arrives here 
as
+    // "hoodie.datasource.meta.sync.glue.catalogid".
+    String lowercaseKey = "hoodie.datasource.meta.sync.glue.catalogid";
+    String configuredCatalogId = "222222222222";
+    TypedProperties properties = GlueTestUtil.getHiveSyncConfig().getProps();
+    properties.setProperty(lowercaseKey, configuredCatalogId);
+    HiveSyncConfig hiveSyncConfig = new HiveSyncConfig(properties);
+    assertEquals(configuredCatalogId, 
hiveSyncConfig.getStringOrDefault(GlueCatalogSyncClientConfig.GLUE_CATALOG_ID, 
"fallback"),
+        "lowercase catalogId key should resolve through withAlternatives, not 
fall back");
+  }
+
   @Test
   void testGetTableLocation_ThrowsException() {
     String tableName = "testTable";

Reply via email to