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/12 17:40:10 UTC

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

viirya commented on a change in pull request #31136:
URL: https://github.com/apache/spark/pull/31136#discussion_r555955789



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala
##########
@@ -395,9 +395,9 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
    * @since 2.0.0
    */
   override def dropTempView(viewName: String): Boolean = {
-    sparkSession.sessionState.catalog.getTempView(viewName).exists { viewDef =>
+    sparkSession.sessionState.catalog.getTempView(viewName).exists { _ =>
       sparkSession.sharedState.cacheManager.uncacheQuery(
-        sparkSession, viewDef, cascade = false)
+        sparkSession.table(viewName), cascade = false)

Review comment:
       Shall we add an assert into `uncacheQuery` to make sure all passed in logical plans are analyzed? e.g.,
   
   ```scala
   def uncacheQuery(
         spark: SparkSession,
         plan: LogicalPlan,
         cascade: Boolean,
         blocking: Boolean = false): Unit = {
       assert(plan.analyzed, "the plan input to `uncacheQuery` should be analyzed")
      ...
   }
   ```




----------------------------------------------------------------
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