granewang commented on code in PR #6778:
URL: https://github.com/apache/gravitino/pull/6778#discussion_r2021965328


##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveProxyPlugin.java:
##########
@@ -60,13 +60,16 @@ public Object doAs(
         // The http authentication use one KDC server, the Hive catalog may 
use another KDC server.
         // The KerberosAuthenticator will remove realm of principal.
         // And then we add the realm of Hive catalog to the user.
+        final String finalPrincipalName;
         String proxyKerberosPrincipalName = principal.getName();
         if (!proxyKerberosPrincipalName.contains("@")) {
-          proxyKerberosPrincipalName =
+          finalPrincipalName =
               String.format("%s@%s", proxyKerberosPrincipalName, 
ops.getKerberosRealm());
+        } else {
+          finalPrincipalName = proxyKerberosPrincipalName;
         }
 
-        proxyUser = 
UserGroupInformation.createProxyUser(proxyKerberosPrincipalName, realUser);
+        proxyUser = UserGroupInformation.createProxyUser(finalPrincipalName, 
realUser);

Review Comment:
   > The logic won't change compared to origin implement. Have you tested this 
by hand?
   
   Sorry. It was an oversight when committing the code.and the code tested 
successfully



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to