sunchao commented on a change in pull request #32410:
URL: https://github.com/apache/spark/pull/32410#discussion_r625335398



##########
File path: 
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
##########
@@ -141,7 +141,7 @@ public void open(Map<String, String> sessionConfMap) throws 
HiveSQLException {
     sessionState = new SessionState(hiveConf, username);
     sessionState.setUserIpAddress(ipAddress);
     sessionState.setIsHiveServerQuery(true);
-    SessionState.start(sessionState);
+    SessionState.setCurrentSessionState(sessionState);

Review comment:
       hmm just curious why we don't need to start the new session in these 
places. Maybe add more details in the PR description?

##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
##########
@@ -190,7 +190,11 @@ private[hive] class HiveClientImpl(
     // For this reason we cannot load the jars added by ADDJarsCommand because 
of class loader
     // got changed. We reset it to clientLoader.ClassLoader here.
     state.getConf.setClassLoader(clientLoader.classLoader)
-    SessionState.start(state)
+    if (version != hive.v12) {
+      SessionState.setCurrentSessionState(state)

Review comment:
       How useful is this? why don't we start the session in `newState`? BTW 
there is already `HiveShim.setCurrentSessionState`.

##########
File path: 
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/CLIService.java
##########
@@ -126,7 +126,7 @@ private void applyAuthorizationConfigPolicy(HiveConf 
newHiveConf) throws HiveExc
     // authorization and authentication are not session specific settings
     SessionState ss = new SessionState(newHiveConf);
     ss.setIsHiveServerQuery(true);
-    SessionState.start(ss);

Review comment:
       Seems there is a bug originally here as the session state is not closed 
and therefore will leave the session directories orphan. 




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

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



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

Reply via email to