diff options
author | Cheng Lian <lian.cs.zju@gmail.com> | 2014-08-03 12:34:46 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-08-03 12:34:46 -0700 |
commit | ac33cbbf33bd1ab29bc8165c9be02fb8934b1fdf (patch) | |
tree | fa9b2eb0bd559e46a17207ddf9954416f8876c6f /sql/hive | |
parent | 236dfac6769016e433b2f6517cda2d308dea74bc (diff) | |
download | spark-ac33cbbf33bd1ab29bc8165c9be02fb8934b1fdf.tar.gz spark-ac33cbbf33bd1ab29bc8165c9be02fb8934b1fdf.tar.bz2 spark-ac33cbbf33bd1ab29bc8165c9be02fb8934b1fdf.zip |
[SPARK-2814][SQL] HiveThriftServer2 throws NPE when executing native commands
JIRA issue: [SPARK-2814](https://issues.apache.org/jira/browse/SPARK-2814)
Author: Cheng Lian <lian.cs.zju@gmail.com>
Closes #1753 from liancheng/spark-2814 and squashes the following commits:
c74a3b2 [Cheng Lian] Fixed SPARK-2814
Diffstat (limited to 'sql/hive')
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala index 7db0159512..acad681f68 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala @@ -146,13 +146,12 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) { @transient protected[hive] lazy val sessionState = { val ss = new SessionState(hiveconf) set(hiveconf.getAllProperties) // Have SQLConf pick up the initial set of HiveConf. - - ss.err = new PrintStream(outputBuffer, true, "UTF-8") - ss.out = new PrintStream(outputBuffer, true, "UTF-8") - ss } + sessionState.err = new PrintStream(outputBuffer, true, "UTF-8") + sessionState.out = new PrintStream(outputBuffer, true, "UTF-8") + override def set(key: String, value: String): Unit = { super.set(key, value) runSqlHive(s"SET $key=$value") |