aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Davidson <aaron@databricks.com>2014-06-20 17:55:54 -0700
committerReynold Xin <rxin@apache.org>2014-06-20 17:55:54 -0700
commit2044784915554a890ca6f8450d8403495b2ee4f3 (patch)
tree6b0db91ff43a31f05c51fb433491d83afc395bb1
parentd4c7572dba1be49e55ceb38713652e5bcf485be8 (diff)
downloadspark-2044784915554a890ca6f8450d8403495b2ee4f3.tar.gz
spark-2044784915554a890ca6f8450d8403495b2ee4f3.tar.bz2
spark-2044784915554a890ca6f8450d8403495b2ee4f3.zip
[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 <aaron@databricks.com> Closes #1148 from aarondav/createtable and squashes the following commits: 37c3e7c [Aaron Davidson] [SQL] Use hive.SessionState, not the thread local SessionState
-rw-r--r--sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
index f923d68932..faa30c9ae5 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
@@ -105,7 +105,7 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
object CreateTables extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
case InsertIntoCreatedTable(db, tableName, child) =>
- val databaseName = db.getOrElse(SessionState.get.getCurrentDatabase)
+ val databaseName = db.getOrElse(hive.sessionState.getCurrentDatabase)
createTable(databaseName, tableName, child.output)