diff options
author | Aaron Davidson <aaron@databricks.com> | 2014-06-20 17:55:54 -0700 |
---|---|---|
committer | Reynold Xin <rxin@apache.org> | 2014-06-20 17:56:26 -0700 |
commit | 36668662f6a6842d90c83a1f83e612d7a3f09831 (patch) | |
tree | eeb46ce2c9675209432521041f6e7c18c6782ab8 | |
parent | 91dc0641c5ca2a8d8bf40cc83d361b4fb3d9c03c (diff) | |
download | spark-36668662f6a6842d90c83a1f83e612d7a3f09831.tar.gz spark-36668662f6a6842d90c83a1f83e612d7a3f09831.tar.bz2 spark-36668662f6a6842d90c83a1f83e612d7a3f09831.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
(cherry picked from commit 2044784915554a890ca6f8450d8403495b2ee4f3)
Signed-off-by: Reynold Xin <rxin@apache.org>
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala | 2 |
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) |