cloud-fan commented on a change in pull request #26589: [SPARK-29947][SQL] 
Improve ResolveRelations performance
URL: https://github.com/apache/spark/pull/26589#discussion_r362706300
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ##########
 @@ -870,7 +874,8 @@ class Analyzer(
         case SessionCatalogAndIdentifier(catalog, ident) =>
           CatalogV2Util.loadTable(catalog, ident).map {
             case v1Table: V1Table =>
-              v1SessionCatalog.getRelation(v1Table.v1Table)
+              AnalysisContext.get.relationCache.getOrElseUpdate(
+                v1Table.v1Table.qualifiedName, 
v1SessionCatalog.getRelation(v1Table.v1Table))
 
 Review comment:
   the key should be a fully qualified name, including catalog name. We may 
have different tables in different catalogs with the same name.
   
   how about
   ```
   val key = catalog.name +: ident.namespace :+ ident.name
   relationCache.getOrElseUpdate(key, ...)
   ```
   ```
   
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to