Skip to content

Commit a28fef5

Browse files
committed
Avoid starting HiveContext.sessionState multiple times
1 parent 49b1c5b commit a28fef5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
300300
// Spark SQL Hive support uses a single `SessionState` for all Hive operations and breaks
301301
// session isolation under multi-user scenarios (i.e. HiveThriftServer2).
302302
// TODO Fix session isolation
303-
SessionState.start(sessionState)
303+
if (SessionState.get() != sessionState) {
304+
SessionState.start(sessionState)
305+
}
304306

305307
proc match {
306308
case driver: Driver =>

0 commit comments

Comments
 (0)