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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to