cloud-fan commented on code in PR #52764:
URL: https://github.com/apache/spark/pull/52764#discussion_r2471560848
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala:
##########
@@ -365,6 +368,44 @@ class CacheManager extends Logging with
AdaptiveSparkPlanHelper {
}
}
+ private[sql] def lookupCachedTable(
+ name: Seq[String],
+ timeTravelSpec: Option[TimeTravelSpec],
+ conf: SQLConf): Option[LogicalPlan] = {
+ val cachedRelations = findCachedRelations(name, timeTravelSpec, conf)
+ cachedRelations match {
+ case cachedRelation +: _ =>
+ val nameWithTimeTravel = timeTravelSpec match {
+ case Some(spec) => s"${name.quoted} $spec"
+ case None => name.quoted
+ }
+ CacheManager.logCacheOperation(
+ log"Relation cache hit for table ${MDC(TABLE_NAME,
nameWithTimeTravel)}")
+ Some(cachedRelation)
Review Comment:
hmm we just return the first match? Shall we use the scan with the latest
table version?
--
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]