You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2015/02/05 00:22:44 UTC
spark git commit: [SQL] Use HiveContext's sessionState in
HiveMetastoreCatalog.hiveDefaultTableFilePath
Repository: spark
Updated Branches:
refs/heads/master 0d81645f7 -> 548c9c2b2
[SQL] Use HiveContext's sessionState in HiveMetastoreCatalog.hiveDefaultTableFilePath
`client.getDatabaseCurrent` uses SessionState's local variable which can be an issue.
Author: Yin Huai <yh...@databricks.com>
Closes #4355 from yhuai/defaultTablePath and squashes the following commits:
84a29e5 [Yin Huai] Use HiveContext's sessionState instead of using SessionState's thread local variable.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/548c9c2b
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/548c9c2b
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/548c9c2b
Branch: refs/heads/master
Commit: 548c9c2b2a1612f5e4342de322b72b9e78140618
Parents: 0d81645
Author: Yin Huai <yh...@databricks.com>
Authored: Wed Feb 4 15:22:40 2015 -0800
Committer: Michael Armbrust <mi...@databricks.com>
Committed: Wed Feb 4 15:22:40 2015 -0800
----------------------------------------------------------------------
.../scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/548c9c2b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala
----------------------------------------------------------------------
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 bcb4726..2433106 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
@@ -140,7 +140,8 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
}
def hiveDefaultTableFilePath(tableName: String): String = {
- hiveWarehouse.getTablePath(client.getDatabaseCurrent, tableName).toString
+ val currentDatabase = client.getDatabase(hive.sessionState.getCurrentDatabase())
+ hiveWarehouse.getTablePath(currentDatabase, tableName).toString
}
def tableExists(tableIdentifier: Seq[String]): Boolean = {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org