Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17154#discussion_r104270996
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala 
---
    @@ -268,16 +268,19 @@ private[hive] class HiveClientImpl(
        */
       def withHiveState[A](f: => A): A = retryLocked {
         val original = Thread.currentThread().getContextClassLoader
    -    // Set the thread local metastore client to the client associated with 
this HiveClientImpl.
    -    Hive.set(client)
    +    val originalConfLoader = state.getConf.getClassLoader
         // The classloader in clientLoader could be changed after addJar, 
always use the latest
         // classloader
    +    Thread.currentThread().setContextClassLoader(clientLoader.classLoader)
    --- End diff --
    
    shall we add some comments to say why we need to do this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to