You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/12/04 12:08:04 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #26741: [SPARK-30104][SQL] Fix catalog resolution for 'global_temp'

cloud-fan commented on a change in pull request #26741: [SPARK-30104][SQL] Fix catalog resolution for 'global_temp'
URL: https://github.com/apache/spark/pull/26741#discussion_r353705982
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/LookupCatalog.scala
 ##########
 @@ -133,7 +133,11 @@ private[sql] trait LookupCatalog extends Logging {
         // For example, if the name of a custom catalog is the same with `GLOBAL_TEMP_DATABASE`,
         // this custom catalog can't be accessed.
         if (nameParts.head.equalsIgnoreCase(globalTempDB)) {
 
 Review comment:
   How about we follow the table loopup logic here
   ```
   object CatalogAndIdentifierParts {
     def unapply(nameParts: Seq[String]): Option[(CatalogPlugin, Seq[String])] = {
       if (nameParts.length == 1) {
         Some((currentCatalog, currentNamespace ++ nameParts))
       } else if (nameParts.length == 2 && nameParts.head.equalsIgnoreCase(globalTempDB)) {
         Some((catalogManager.v2SessionCatalog, nameParts))
       } else {
         try ... catch ...
       }
     }
   }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org