sunchao commented on a change in pull request #31107: URL: https://github.com/apache/spark/pull/31107#discussion_r560390493
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ########## @@ -237,8 +237,10 @@ case class DropTableCommand( if (isTempView || catalog.tableExists(tableName)) { try { + val hasViewText = isTempView && + catalog.getTempViewOrPermanentTableMetadata(tableName).viewText.isDefined sparkSession.sharedState.cacheManager.uncacheQuery( - sparkSession.table(tableName), cascade = !isTempView) + sparkSession.table(tableName), cascade = !isTempView || hasViewText) Review comment: Yes the PR title is not very good - I just updated it. I think the description is more aligned to what the PR does but I'll try to add more details there. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org