cloud-fan commented on a change in pull request #33175:
URL: https://github.com/apache/spark/pull/33175#discussion_r664348918
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala
##########
@@ -662,6 +662,14 @@ case class ShowCurrentNamespace(catalogManager:
CatalogManager) extends LeafComm
AttributeReference("namespace", StringType, nullable = false)())
}
+/**
+ * The logical plan of the SHOW CATALOGS command.
+ */
+case class ShowCatalogs(catalogManager: CatalogManager) extends LeafCommand {
+ override val output: Seq[Attribute] = Seq(
+ AttributeReference("catalog", StringType, nullable = false)())
Review comment:
do we have a reference? what other databases return in SHOW CATALOGS?
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogManager.scala
##########
@@ -128,6 +128,10 @@ class CatalogManager(
}
}
+ def listCatalogs(): mutable.HashMap[String, CatalogPlugin] = synchronized {
+ catalogs
Review comment:
Catalogs are lazily loaded. Before we load them, we don't know which
catalogs are available (people can set configs at runtime). This is a drawback
of using configs to load catalogs, we probably should use a more explicit way
to load/register a catalog.
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogManager.scala
##########
@@ -128,6 +128,10 @@ class CatalogManager(
}
}
+ def listCatalogs(): mutable.HashMap[String, CatalogPlugin] = synchronized {
+ catalogs
Review comment:
Catalogs are lazily loaded. Before we load them, we don't know which
catalogs are available (people can set configs at runtime). This is a drawback
of using configs to load catalogs, we probably should use a more explicit way
to load/register a catalog, but it's off-topic here.
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala
##########
@@ -662,6 +662,14 @@ case class ShowCurrentNamespace(catalogManager:
CatalogManager) extends LeafComm
AttributeReference("namespace", StringType, nullable = false)())
}
+/**
+ * The logical plan of the SHOW CATALOGS command.
+ */
+case class ShowCatalogs(catalogManager: CatalogManager) extends LeafCommand {
+ override val output: Seq[Attribute] = Seq(
+ AttributeReference("catalog", StringType, nullable = false)())
Review comment:
can you link to the presto doc? and can you also check some traditional
RDBMS?
--
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]