cloud-fan commented on a change in pull request #31107:
URL: https://github.com/apache/spark/pull/31107#discussion_r560047601
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala
##########
@@ -417,17 +411,25 @@ class CatalogImpl(sparkSession: SparkSession) extends
Catalog {
*/
override def dropGlobalTempView(viewName: String): Boolean = {
sparkSession.sessionState.catalog.getGlobalTempView(viewName).exists {
viewDef =>
- try {
- val plan = sparkSession.sessionState.executePlan(viewDef)
- sparkSession.sharedState.cacheManager.uncacheQuery(
- sparkSession, plan.analyzed, cascade = false)
- } catch {
- case NonFatal(_) => // ignore
- }
+ uncacheView(viewDef)
sessionCatalog.dropGlobalTempView(viewName)
}
}
+ private def uncacheView(viewDef: LogicalPlan): Unit = {
+ try {
+ val viewText = viewDef match {
+ case v: View => v.desc.viewText
+ case _ => None
+ }
+ val plan = sparkSession.sessionState.executePlan(viewDef)
+ sparkSession.sharedState.cacheManager.uncacheQuery(
+ sparkSession, plan.analyzed, cascade = viewText.isDefined)
Review comment:
A view without view text is dataframe temp views, or legacy SQL temp
views. We shouldn't change their behavior and keep the non-cascade uncache.
----------------------------------------------------------------
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]