aokolnychyi commented on code in PR #56121:
URL: https://github.com/apache/spark/pull/56121#discussion_r3358267785


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala:
##########
@@ -489,16 +492,37 @@ class CacheManager extends Logging with 
AdaptiveSparkPlanHelper {
     result
   }
 
+  // Decides whether the cached entry can be substituted into a plan being 
executed inside
+  // the given transaction. Collects only the scans whose table belongs to the 
transaction's
+  // catalog and asks the connector whether reusing the cached snapshot is 
compatible with its
+  // isolation contract.
+  private def validateCachedEntryForTransaction(cd: CachedData, txn: 
Transaction): Boolean = {
+    val txnCatalogName = txn.catalog().name()
+    val txnTables = 
cd.cachedRepresentation.cacheBuilder.logicalPlan.collectWithSubqueries {

Review Comment:
   Why do we have to collect `txnTables` before traversing the physical plan?



-- 
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]

Reply via email to