aokolnychyi commented on code in PR #52599:
URL: https://github.com/apache/spark/pull/52599#discussion_r2449684004
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala:
##########
@@ -214,12 +221,33 @@ class CacheManager extends Logging with
AdaptiveSparkPlanHelper {
uncacheByCondition(spark, _.sameResult(plan), cascade, blocking)
}
- def uncacheTableOrView(spark: SparkSession, name: Seq[String], cascade:
Boolean): Unit = {
+ private[sql] def uncacheRelation(
+ spark: SparkSession,
+ relation: LogicalPlan,
+ cascade: Boolean): Unit = {
+ EliminateSubqueryAliases(relation) match {
+ case r @ ExtractV2CatalogAndIdentifier(catalog, ident) if
r.timeTravelSpec.isEmpty =>
+ val nameParts = ident.toQualifiedNameParts(catalog)
+ uncacheTableOrView(spark, nameParts, cascade)
+ case _ =>
+ uncacheQuery(spark, relation, cascade)
+ }
+ }
+
+ def uncacheTableOrView(
+ spark: SparkSession,
+ name: Seq[String],
+ cascade: Boolean,
+ blocking: Boolean = false): Unit = {
uncacheByCondition(
- spark, isMatchedTableOrView(_, name, spark.sessionState.conf), cascade,
blocking = false)
+ spark, isMatchedTableOrView(_, name, spark.sessionState.conf), cascade,
blocking)
}
- private def isMatchedTableOrView(plan: LogicalPlan, name: Seq[String], conf:
SQLConf): Boolean = {
+ private def isMatchedTableOrView(
+ plan: LogicalPlan,
+ name: Seq[String],
+ conf: SQLConf,
+ includeTimeTravel: Boolean = true): Boolean = {
Review Comment:
We previously tried to reach all plans so it is generally safer to uncache
and opt in into preserving time travel in each case individually. What do you
think?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]