Skip to content

Commit 59c884f

Browse files
marmbrusyhuai
authored andcommitted
[SQL] Lock metastore client in analyzeTable
1 parent 7667030 commit 59c884f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
181181
val tableFullName =
182182
relation.hiveQlTable.getDbName + "." + relation.hiveQlTable.getTableName
183183

184-
catalog.client.alterTable(tableFullName, new Table(hiveTTable))
184+
catalog.synchronized {
185+
catalog.client.alterTable(tableFullName, new Table(hiveTTable))
186+
}
185187
}
186188
case otherRelation =>
187189
throw new NotImplementedError(

0 commit comments

Comments
 (0)