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_r355818196
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/LookupCatalog.scala
 ##########
 @@ -140,28 +140,33 @@ private[sql] trait LookupCatalog extends Logging {
   }
 
   /**
-   * Extract catalog and the rest name parts from a multi-part identifier.
+   * Extract catalog and the rest name parts as a table identifier.
+   * This does not return an empty array as a table name, thus for the 
single-part name,
+   * it is resolved to a table name, not a catalog.
    */
-  object CatalogAndIdentifierParts {
+  object CatalogAndTable {
     private val globalTempDB = 
SQLConf.get.getConf(StaticSQLConf.GLOBAL_TEMP_DATABASE)
 
     def unapply(nameParts: Seq[String]): Option[(CatalogPlugin, Seq[String])] 
= {
 
 Review comment:
   shall we return `Identifer` instead of `Seq[String]`? Then it's guaranteed 
that we won't return invalid table name.

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


With regards,
Apache Git Services

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

Reply via email to