lifangyu commented on code in PR #6923:
URL: https://github.com/apache/gravitino/pull/6923#discussion_r2060169756


##########
catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackendOps.java:
##########
@@ -236,12 +249,30 @@ private HiveConf buildHiveConf(Map<String, String> 
properties) {
             byPassConfigs.put(key.substring(CATALOG_BYPASS_PREFIX.length()), 
value);
           } else if (CONFIG_CONVERTER.containsKey(key)) {
             convertedConfigs.put(CONFIG_CONVERTER.get(key), value);
+          } else {
+            hadoopConf.set(key, value);
           }
         });
     byPassConfigs.forEach(hadoopConf::set);
-    // Gravitino conf has higher priority than bypass conf
     convertedConfigs.forEach(hadoopConf::set);
-
+    initKerberosAuth(properties, hadoopConf);
     return new HiveConf(hadoopConf, HudiHMSBackendOps.class);
   }
+
+  private void initKerberosAuth(Map<String, String> properties, Configuration 
hadoopConf) {
+    AuthenticationConfig authenticationConfig = new 
AuthenticationConfig(properties);
+    if (authenticationConfig.isKerberosAuth()) {
+      try (KerberosClient kerberosClient = new KerberosClient(properties, 
hadoopConf, true)) {
+        String keytabPath =
+            String.format(
+                GRAVITINO_KEYTAB_FORMAT, Objects.isNull(this.info) ? "0" : 
this.info.id());

Review Comment:
   Well, after consideration, your suggestions for optimization have been 
adopted.



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