Github user aarondav commented on a diff in the pull request:
https://github.com/apache/spark/pull/6758#discussion_r32253172
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/commands.scala ---
@@ -91,7 +91,7 @@ case class AddJar(path: String) extends RunnableCommand {
val jarURL = new java.io.File(path).toURL
val newClassLoader = new java.net.URLClassLoader(Array(jarURL),
currentClassLoader)
Thread.currentThread.setContextClassLoader(newClassLoader)
-
org.apache.hadoop.hive.ql.metadata.Hive.get().getConf().setClassLoader(newClassLoader)
+ hiveContext.executionHive.state.getConf.setClassLoader(newClassLoader)
--- End diff --
This is very likely to work for almost all cases, but we should probably
add a TODO or JIRA to clean up some of this stuff. For instance, here we may be
setting the executionHive class loader to an entirely different class loader
than it originally had (which is likely to work in typical situations, but is
not easy to trace).
Additionally, the flow of class loader-setting inside ClientWrapper is very
non-obvious, especially as it differs between Hive 12 and Hive 13 -- we should
explicitly document this if not make it cleaner.
---
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]