Skip to content

Commit 84a29e5

Browse files
committed
Use HiveContext's sessionState instead of using SessionState's thread local variable.
1 parent e380d2d commit 84a29e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
140140
}
141141

142142
def hiveDefaultTableFilePath(tableName: String): String = {
143-
hiveWarehouse.getTablePath(client.getDatabaseCurrent, tableName).toString
143+
val currentDatabase = client.getDatabase(hive.sessionState.getCurrentDatabase())
144+
hiveWarehouse.getTablePath(currentDatabase, tableName).toString
144145
}
145146

146147
def tableExists(tableIdentifier: Seq[String]): Boolean = {

0 commit comments

Comments
 (0)