srowen commented on a change in pull request #25775: 
[SPARK-29015][SQL][test-hadoop3.2]Reset class loader after initializing 
SessionState for built-in Hive 2.3
URL: https://github.com/apache/spark/pull/25775#discussion_r328583274
 
 

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
 ##########
 @@ -190,6 +190,13 @@ private[hive] class HiveClientImpl(
     if (clientLoader.cachedHive != null) {
       Hive.set(clientLoader.cachedHive.asInstanceOf[Hive])
     }
+    // Hive 2.3 will set UDFClassLoader to hiveConf when initializing 
SessionState
+    // since HIVE-11878, and ADDJarCommand will add jars to 
clientLoader.classLoader.
+    // For this reason we cannot load the jars added by ADDJarCommand because 
of class loader
+    // got changed. We reset it to clientLoader.ClassLoader here.
+    if (HiveUtils.isHive23) {
+      state.getConf.setClassLoader(clientLoader.classLoader)
+    }
     SessionState.start(state)
 
 Review comment:
   @wangyum are you saying this change shouldn't be merged yet, or there is a 
different issue, and this change is OK?

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


With regards,
Apache Git Services

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

Reply via email to