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 2020/11/04 19:46:59 UTC
[GitHub] [spark] sunchao commented on a change in pull request #30187: [SPARK-33290][SQL] REFRESH TABLE should invalidate cache even though the table itself may not be cached
sunchao commented on a change in pull request #30187:
URL: https://github.com/apache/spark/pull/30187#discussion_r517590557
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala
##########
@@ -524,14 +527,17 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
// If this table is cached as an InMemoryRelation, drop the original
// cached version and make the new version cached lazily.
val cache = sparkSession.sharedState.cacheManager.lookupCachedData(table)
+
+ // uncache the logical plan.
+ // note this is a no-op for the table itself if it's not cached, but will invalidate all
+ // caches referencing this table.
+ sparkSession.sharedState.cacheManager.uncacheQuery(table, cascade = true)
Review comment:
hmm which migration guide should I add this to? note Spark already invalidate cache when the target table is cached, and this just extend it to the case when the table itself is not cached.
----------------------------------------------------------------
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