amaliujia commented on code in PR #37287:
URL: https://github.com/apache/spark/pull/37287#discussion_r930309561


##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -78,22 +67,18 @@ class CatalogImpl(sparkSession: SparkSession) extends 
Catalog {
    * Returns a list of databases available across all sessions.
    */
   override def listDatabases(): Dataset[Database] = {
-    val catalog = currentCatalog()
-    val plan = ShowNamespaces(UnresolvedNamespace(Seq(catalog)), None)
-    val databases = sparkSession.sessionState.executePlan(plan).toRdd.collect()
-      .map(row => catalog + "." + row.getString(0))
-      .map(getDatabase)
+    val plan = ShowNamespaces(UnresolvedNamespace(Nil), None)

Review Comment:
   To clarify: so the `UnresolvedNamespace` will follow currentCatalog when 
input catalog is Nil?



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