Skip to content

Commit ac33cbb

Browse files
lianchengmarmbrus
authored andcommitted
[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 <[email protected]> Closes #1753 from liancheng/spark-2814 and squashes the following commits: c74a3b2 [Cheng Lian] Fixed SPARK-2814
1 parent 236dfac commit ac33cbb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,12 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
146146
@transient protected[hive] lazy val sessionState = {
147147
val ss = new SessionState(hiveconf)
148148
set(hiveconf.getAllProperties) // Have SQLConf pick up the initial set of HiveConf.
149-
150-
ss.err = new PrintStream(outputBuffer, true, "UTF-8")
151-
ss.out = new PrintStream(outputBuffer, true, "UTF-8")
152-
153149
ss
154150
}
155151

152+
sessionState.err = new PrintStream(outputBuffer, true, "UTF-8")
153+
sessionState.out = new PrintStream(outputBuffer, true, "UTF-8")
154+
156155
override def set(key: String, value: String): Unit = {
157156
super.set(key, value)
158157
runSqlHive(s"SET $key=$value")

0 commit comments

Comments
 (0)