yyanyy commented on code in PR #57799:
URL: https://github.com/apache/spark/pull/57799#discussion_r3725716155


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/RelationResolution.scala:
##########
@@ -476,23 +489,60 @@ class RelationResolution(
 
   def resolveReference(ref: V2TableReference): LogicalPlan = {
     val relation = if (ref.context.cacheable) {
-      getOrLoadRelation(ref)
+      val useSharedRelationCache =
+        ref.context.isInstanceOf[V2TableReference.TemporaryViewContext]
+      getOrLoadRelation(ref, useSharedRelationCache)

Review Comment:
   The other case here for now is `TransactionContext` that shouldn't use 
shared relation cache to avoid replacing the table earlier than the appropriate 
transaction check to decide if a cache reuse is safe (`txn.registerScans`?)



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