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

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


The following commit(s) were added to refs/heads/master by this push:
     new 074ddc282567 [SPARK-47898][SQL] Port HIVE-12270: Add DBTokenStore 
support to HS2 delegation token
074ddc282567 is described below

commit 074ddc2825674edcea1bb7febf2c6d8b27c2e375
Author: Kent Yao <y...@apache.org>
AuthorDate: Thu Apr 18 10:23:11 2024 -0700

    [SPARK-47898][SQL] Port HIVE-12270: Add DBTokenStore support to HS2 
delegation token
    
    ### What changes were proposed in this pull request?
    
    This PR ports `HIVE-12270: Add DBTokenStore support to HS2 delegation 
token`. This is a partial, as tests and other diffs that are already in the 
upstream artifacts are not necessary.
    
    ### Why are the changes needed?
    
    This PR can reduce the usage of HMS classes in spark-thriftserver, a small 
step for reducing blocker for upgrading builtin Hive
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    Pass build
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    no
    
    Closes #46115 from yaooqinn/SPARK-47898.
    
    Authored-by: Kent Yao <y...@apache.org>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 .../java/org/apache/hive/service/auth/HiveAuthFactory.java    | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git 
a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java
 
b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java
index e3316cef241c..c48f4e3ec7b0 100644
--- 
a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java
+++ 
b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java
@@ -27,9 +27,7 @@ import javax.security.sasl.Sasl;
 
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
-import org.apache.hadoop.hive.metastore.HiveMetaStore;
-import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler;
-import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.ql.metadata.Hive;
 import org.apache.hadoop.hive.shims.HadoopShims.KerberosNameShim;
 import org.apache.hadoop.hive.shims.ShimLoader;
 import org.apache.hadoop.hive.thrift.DBTokenStore;
@@ -132,16 +130,15 @@ public class HiveAuthFactory {
               HiveConf.ConfVars.METASTORE_CLUSTER_DELEGATION_TOKEN_STORE_CLS);
 
           if (tokenStoreClass.equals(DBTokenStore.class.getName())) {
-            HMSHandler baseHandler = new HiveMetaStore.HMSHandler(
-                "new db based metaserver", conf, true);
-            rawStore = baseHandler.getMS();
+            // Follows https://issues.apache.org/jira/browse/HIVE-12270
+            rawStore = Hive.class;
           }
 
           delegationTokenManager.startDelegationTokenSecretManager(
               conf, rawStore, ServerMode.HIVESERVER2);
           
saslServer.setSecretManager(delegationTokenManager.getSecretManager());
         }
-        catch (MetaException|IOException e) {
+        catch (IOException e) {
           throw new TTransportException("Failed to start token manager", e);
         }
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to