Peng-Lei commented on a change in pull request #33339:
URL: https://github.com/apache/spark/pull/33339#discussion_r697125559



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/LookupCatalog.scala
##########
@@ -84,7 +84,11 @@ private[sql] trait LookupCatalog extends Logging {
     def unapply(nameParts: Seq[String]): Some[(CatalogPlugin, Seq[String])] = {
       assert(nameParts.nonEmpty)
       try {
-        Some((catalogManager.catalog(nameParts.head), nameParts.tail))
+        if (nameParts.length == 1) {
+          Some((currentCatalog, nameParts))
+        } else {
+          Some((catalogManager.catalog(nameParts.head), nameParts.tail))
+        }
       } catch {
         case _: CatalogNotFoundException =>

Review comment:
       Above exception is not `CatalogNotFoundException `. It is the exception 
that the catalog name is not valid. @cloud-fan 




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