srielau commented on code in PR #59874:
URL: https://github.com/apache/spark/pull/59874#discussion_r4632718925


##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/parser/ParseSqlResult.scala:
##########
@@ -682,6 +984,9 @@ object ParseSqlResult {
           add(tempViewParts(r.identifier))
         case r: ResolvedIdentifier if role == TableRefRole.Target =>
           add(catalogIdentParts(r.catalog.name(), r.identifier))
+        case l: LocalRelation =>
+          // A caller-supplied relation (relations overlay) is named by its 
canonical identity.
+          l.getTagValue(SuppliedRelationRegistry.IDENTITY_TAG).foreach(add)

Review Comment:
   Fixed in 4c69a8a9caf. A supplied global temp relation is reported as 
`[spark_catalog, global_temp, name]` (the same spelling as a global temp view), 
by mapping its two-part identity when the walker reports it. I kept 
`SuppliedRelationRegistry.canonicalize` storing `[global_temp, name]`: the 
lookup and the stored key use the same canonical form, so the overlay still 
matches. Covered by the global temp test.



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