You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/13 07:51:31 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #31136: [SPARK-34076][SQL] SQLContext.dropTempTable fails if cache is non-empty

cloud-fan commented on a change in pull request #31136:
URL: https://github.com/apache/spark/pull/31136#discussion_r556321750



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala
##########
@@ -412,8 +417,13 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
    */
   override def dropGlobalTempView(viewName: String): Boolean = {
     sparkSession.sessionState.catalog.getGlobalTempView(viewName).exists { viewDef =>
-      sparkSession.sharedState.cacheManager.uncacheQuery(
-        sparkSession, viewDef, cascade = false)
+      try {
+        val plan = sparkSession.sessionState.executePlan(viewDef)
+        sparkSession.sharedState.cacheManager.uncacheQuery(
+          sparkSession, plan.analyzed, cascade = false)
+      } catch {
+        case NonFatal(_) => // ignore

Review comment:
       is it safer to not add this try-catch? if there are failures, then the uncache fails and we should not swallow the exception?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org