@@ -70,9 +70,7 @@ private[hive] class HiveMetastoreCatalog(val client: ClientInterface, hive: Hive
7070 val cacheLoader = new CacheLoader [QualifiedTableName , LogicalPlan ]() {
7171 override def load (in : QualifiedTableName ): LogicalPlan = {
7272 logDebug(s " Creating new cached data source for $in" )
73- val table = HiveMetastoreCatalog .this .synchronized {
74- client.getTable(in.database, in.name)
75- }
73+ val table = client.getTable(in.database, in.name)
7674
7775 def schemaStringFromParts : Option [String ] = {
7876 table.properties.get(" spark.sql.sources.schema.numParts" ).map { numParts =>
@@ -179,14 +177,14 @@ private[hive] class HiveMetastoreCatalog(val client: ClientInterface, hive: Hive
179177 serdeProperties = options))
180178 }
181179
182- def hiveDefaultTableFilePath (tableName : String ): String = synchronized {
180+ def hiveDefaultTableFilePath (tableName : String ): String = {
183181 // Code based on: hiveWarehouse.getTablePath(currentDatabase, tableName)
184182 new Path (
185183 new Path (client.getDatabase(client.currentDatabase).location),
186184 tableName.toLowerCase).toString
187185 }
188186
189- def tableExists (tableIdentifier : Seq [String ]): Boolean = synchronized {
187+ def tableExists (tableIdentifier : Seq [String ]): Boolean = {
190188 val tableIdent = processTableIdentifier(tableIdentifier)
191189 val databaseName =
192190 tableIdent
@@ -312,7 +310,7 @@ private[hive] class HiveMetastoreCatalog(val client: ClientInterface, hive: Hive
312310 result.newInstance()
313311 }
314312
315- override def getTables (databaseName : Option [String ]): Seq [(String , Boolean )] = synchronized {
313+ override def getTables (databaseName : Option [String ]): Seq [(String , Boolean )] = {
316314 val db = databaseName.getOrElse(client.currentDatabase)
317315
318316 client.listTables(db).map(tableName => (tableName, false ))
0 commit comments