File tree Expand file tree Collapse file tree 2 files changed +3
-20
lines changed
main/scala/org/apache/spark/sql/hive
test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -173,16 +173,12 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
173173
174174 def lookupRelation (
175175 tableIdentifier : Seq [String ],
176- alias : Option [String ]): LogicalPlan = {
176+ alias : Option [String ]): LogicalPlan = synchronized {
177177 val tableIdent = processTableIdentifier(tableIdentifier)
178178 val databaseName = tableIdent.lift(tableIdent.size - 2 ).getOrElse(
179179 hive.sessionState.getCurrentDatabase)
180180 val tblName = tableIdent.last
181- val table = try {
182- synchronized {
183- client.getTable(databaseName, tblName)
184- }
185- } catch {
181+ val table = try client.getTable(databaseName, tblName) catch {
186182 case te : org.apache.hadoop.hive.ql.metadata.InvalidTableException =>
187183 throw new NoSuchTableException
188184 }
@@ -204,9 +200,7 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
204200 } else {
205201 val partitions : Seq [Partition ] =
206202 if (table.isPartitioned) {
207- synchronized {
208- HiveShim .getAllPartitionsOf(client, table).toSeq
209- }
203+ HiveShim .getAllPartitionsOf(client, table).toSeq
210204 } else {
211205 Nil
212206 }
Original file line number Diff line number Diff line change @@ -457,15 +457,4 @@ class SQLQuerySuite extends QueryTest {
457457 dropTempTable(" data" )
458458 setConf(" spark.sql.hive.convertCTAS" , originalConf)
459459 }
460-
461- test(" sanity test for SPARK-6618" ) {
462- (1 to 100 ).par.map { i =>
463- val tableName = s " SPARK_6618_table_ $i"
464- sql(s " CREATE TABLE $tableName (col1 string) " )
465- catalog.lookupRelation(Seq (tableName))
466- table(tableName)
467- tables()
468- sql(s " DROP TABLE $tableName" )
469- }
470- }
471460}
You can’t perform that action at this time.
0 commit comments