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

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


The following commit(s) were added to refs/heads/master by this push:
     new e197890c1d1 HIVE-28209: Allow the use of a proxy user (#5233)
e197890c1d1 is described below

commit e197890c1d11f11bf2547ed18d28d46a3d758c82
Author: Steve Vaughan <[email protected]>
AuthorDate: Thu May 2 18:03:25 2024 -0400

    HIVE-28209: Allow the use of a proxy user (#5233)
    
    * HIVE-28209 Allow the use of a proxy user
    
    The log message indicates that `HADOOP_PROXY_USER` is set, but then doesn't 
allow its use by calling `getRealUser()` which will be `null`.  This change 
allows delegation for HiveMetaStore connections.
    
    * Use getRealUserOrSelf from more recent Hadoop
    
    ---------
    
    Co-authored-by: Steve Vaughan Jr <[email protected]>
---
 .../main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
 
b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index ec7d8bec37d..9f62005d5f3 100644
--- 
a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++ 
b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -255,7 +255,7 @@ public class HiveMetaStoreClient implements 
IMetaStoreClient, AutoCloseable {
       LOG.info(HADOOP_PROXY_USER + " is set. Using delegation "
           + "token for HiveMetaStore connection.");
       try {
-        UserGroupInformation.getLoginUser().getRealUser().doAs(
+        
UserGroupInformation.getRealUserOrSelf(UserGroupInformation.getLoginUser()).doAs(
             new PrivilegedExceptionAction<Void>() {
               @Override
               public Void run() throws Exception {

Reply via email to