aokolnychyi commented on code in PR #52599:
URL: https://github.com/apache/spark/pull/52599#discussion_r2427634914
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala:
##########
@@ -299,8 +320,27 @@ class CacheManager extends Logging with
AdaptiveSparkPlanHelper {
* normalized before being used further.
*/
def recacheByPlan(spark: SparkSession, plan: LogicalPlan): Unit = {
- val normalized = QueryExecution.normalize(spark, plan)
- recacheByCondition(spark, _.plan.exists(_.sameResult(normalized)))
+ EliminateSubqueryAliases(plan) match {
+ case r @ ExtractV2CatalogAndIdentifier(catalog, ident) if
r.timeTravelSpec.isEmpty =>
+ val nameParts = ident.toQualifiedNameParts(catalog)
+ recacheByTableName(spark, nameParts)
+ case _ =>
+ val normalized = QueryExecution.normalize(spark, plan)
+ recacheByCondition(spark, _.plan.exists(_.sameResult(normalized)))
+ }
+ }
+
+ /**
+ * Re-caches all cache entries that reference the given table name.
+ */
+ def recacheByTableName(
Review Comment:
I will need this in subsequent PRs.
--
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]