[SPARK-3746][SQL] Lock hive client when creating tables
Author: Michael Armbrust <michael@databricks.com> Closes #2598 from marmbrus/hiveClientLock and squashes the following commits: ca89fe8 [Michael Armbrust] Lock hive client when creating tables
This commit is contained in:
parent
17333c7a3c
commit
fcad3fae61
|
@ -96,10 +96,12 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
|
||||||
serDeInfo.setParameters(Map[String, String]())
|
serDeInfo.setParameters(Map[String, String]())
|
||||||
sd.setSerdeInfo(serDeInfo)
|
sd.setSerdeInfo(serDeInfo)
|
||||||
|
|
||||||
try client.createTable(table) catch {
|
synchronized {
|
||||||
case e: org.apache.hadoop.hive.ql.metadata.HiveException
|
try client.createTable(table) catch {
|
||||||
if e.getCause.isInstanceOf[org.apache.hadoop.hive.metastore.api.AlreadyExistsException] &&
|
case e: org.apache.hadoop.hive.ql.metadata.HiveException
|
||||||
allowExisting => // Do nothing.
|
if e.getCause.isInstanceOf[org.apache.hadoop.hive.metastore.api.AlreadyExistsException] &&
|
||||||
|
allowExisting => // Do nothing.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue