MaxGekk commented on a change in pull request #30711:
URL: https://github.com/apache/spark/pull/30711#discussion_r540380914
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
##########
@@ -981,6 +982,19 @@ private[spark] class HiveExternalCatalog(conf: SparkConf,
hadoopConf: Configurat
spec.map { case (k, v) => partCols.find(_.equalsIgnoreCase(k)).get -> v }
}
+ private def isAlreadyExistsException(e: Throwable): Boolean = {
+ val maxDepth = 4
+ var depth = 0
+ var cause = e
+ var found = false
+ while (!found && depth < maxDepth && cause != null) {
+ found = cause.getClass.getCanonicalName ==
classOf[AlreadyExistsException].getCanonicalName
Review comment:
I had to compare exceptions by their names because pattern matching and
`isInstanceOf` don't work as we could expect. See the comment:
https://github.com/apache/spark/blob/781e19c4d1f376b52e5305078356bf0a58522bcd/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala#L83-L84
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]