Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/17154#discussion_r104270472
--- 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)
state.getConf.setClassLoader(clientLoader.classLoader)
--- End diff --
Yes; I'm not sure the second one is strictly necessary, but from a
cleanliness p.o.v. it looks like the right thing to do.
---
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]