Skip to content

Commit 2044784

Browse files
aarondavrxin
authored andcommitted
[SQL] Use hive.SessionState, not the thread local SessionState
Note that this is simply mimicing lookupRelation(). I do not have a concrete notion of why this solution is necessarily right-er than SessionState.get, but SessionState.get is returning null, which is bad. Author: Aaron Davidson <[email protected]> Closes #1148 from aarondav/createtable and squashes the following commits: 37c3e7c [Aaron Davidson] [SQL] Use hive.SessionState, not the thread local SessionState
1 parent d4c7572 commit 2044784

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
105105
object CreateTables extends Rule[LogicalPlan] {
106106
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
107107
case InsertIntoCreatedTable(db, tableName, child) =>
108-
val databaseName = db.getOrElse(SessionState.get.getCurrentDatabase)
108+
val databaseName = db.getOrElse(hive.sessionState.getCurrentDatabase)
109109

110110
createTable(databaseName, tableName, child.output)
111111

0 commit comments

Comments
 (0)