aboutsummaryrefslogtreecommitdiff
path: root/sql/hive-thriftserver/src/main
diff options
context:
space:
mode:
authorYin Huai <yhuai@databricks.com>2015-08-25 12:49:50 +0800
committerCheng Lian <lian@databricks.com>2015-08-25 12:49:50 +0800
commita0c0aae1defe5e1e57704065631d201f8e3f6bac (patch)
tree8ea6dafafcfa0bd33c45662a481834845c2c384c /sql/hive-thriftserver/src/main
parent642c43c81c835139e3f35dfd6a215d668a474203 (diff)
downloadspark-a0c0aae1defe5e1e57704065631d201f8e3f6bac.tar.gz
spark-a0c0aae1defe5e1e57704065631d201f8e3f6bac.tar.bz2
spark-a0c0aae1defe5e1e57704065631d201f8e3f6bac.zip
[SPARK-10121] [SQL] Thrift server always use the latest class loader provided by the conf of executionHive's state
https://issues.apache.org/jira/browse/SPARK-10121 Looks like the problem is that if we add a jar through another thread, the thread handling the JDBC session will not get the latest classloader. Author: Yin Huai <yhuai@databricks.com> Closes #8368 from yhuai/SPARK-10121.
Diffstat (limited to 'sql/hive-thriftserver/src/main')
-rw-r--r--sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
index 833bf62d47..02cc7e5efa 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
@@ -159,6 +159,12 @@ private[hive] class SparkExecuteStatementOperation(
// User information is part of the metastore client member in Hive
hiveContext.setSession(currentSqlSession)
+ // Always use the latest class loader provided by executionHive's state.
+ val executionHiveClassLoader =
+ hiveContext.executionHive.state.getConf.getClassLoader
+ sessionHive.getConf.setClassLoader(executionHiveClassLoader)
+ parentSessionState.getConf.setClassLoader(executionHiveClassLoader)
+
Hive.set(sessionHive)
SessionState.setCurrentSessionState(parentSessionState)
try {