Repository: spark Updated Branches: refs/heads/branch-1.3 513bb2c84 -> cb4c3e55c
[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. (cherry picked from commit 548c9c2b2a1612f5e4342de322b72b9e78140618) Signed-off-by: Michael Armbrust <mich...@databricks.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/cb4c3e55 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/cb4c3e55 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/cb4c3e55 Branch: refs/heads/branch-1.3 Commit: cb4c3e55c09289e208384b1c0bc3dd5761b8c3b6 Parents: 513bb2c Author: Yin Huai <yh...@databricks.com> Authored: Wed Feb 4 15:22:40 2015 -0800 Committer: Michael Armbrust <mich...@databricks.com> Committed: Wed Feb 4 15:22:52 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/cb4c3e55/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-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org