yaooqinn commented on a change in pull request #25775:
URL: https://github.com/apache/spark/pull/25775#discussion_r565960900



##########
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) {

Review comment:
       Why not set the classLoader blindly to `clientLoader.classLoader`? 
HIVE-11878 got merged into hive 1.3.0 and 2.0.0? This issue can still exist in 
the production environment when we try to use non-builtin hive libraries.
   
   cc @ulysses-you @cloud-fan @wangyum @AngersZhuuuu 




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to