Skip to content

Commit 37c3e7c

Browse files
committed
[SQL] Use hive.SessionState, not the thread local SessionState
Note that this is simply mimicing lookupRelation(). I do not have a conrete notion of why this solution is necessarily right-er than SessionState.get, but SessionState.get is returning null.
1 parent 7dd9fc6 commit 37c3e7c

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)