Peng-Lei commented on a change in pull request #33175: URL: https://github.com/apache/spark/pull/33175#discussion_r664475325
########## 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: in big data: 1.[Presto](https://prestodb.io/docs/current/sql/show-catalogs.html), There is no output information in the link, but actual output is just `name` 2.[Flink](https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/dev/table/sql/show/#run-a-show-statement). in RDBMS The catalog layer is not strictly implemented in RDS 1.In PG, Catalog(=database).Schema(namespace).Table, So `show catalogs` == `show databases`; Unfortunately, pg doesn't have this command. we should use `select statement` instead of `show` command. databases; [difference-between-a-catalog-and-a-schema-in-a-relational-database](https://stackoverflow.com/questions/7022755/whats-the-difference-between-a-catalog-and-a-schema-in-a-relational-database) 2.In MySQL, There is no catalog, just schema(database).table. So we can create a database use create schema/database xxx 3.In Oracle,The is no catalog, if we want access metadata, we can use select statement.[Link](https://en.wikipedia.org/wiki/Oracle_metadata ) ########## 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: in big data: 1.[Presto](https://prestodb.io/docs/current/sql/show-catalogs.html), There is no output information in the link, but actual output is just `name` 2.[Flink](https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/dev/table/sql/show/#run-a-show-statement). in RDBMS The catalog layer is not strictly implemented in RDS 1.In PG, Catalog(=database).Schema(namespace).Table, So `show catalogs` == `show databases`; Unfortunately, pg doesn't have this command. we should use `select statement` instead of `show` command. [difference-between-a-catalog-and-a-schema-in-a-relational-database](https://stackoverflow.com/questions/7022755/whats-the-difference-between-a-catalog-and-a-schema-in-a-relational-database) 2.In MySQL, There is no catalog, just schema(database).table. So we can create a database use create schema/database xxx 3.In Oracle,The is no catalog, if we want access metadata, we can use select statement.[Link](https://en.wikipedia.org/wiki/Oracle_metadata ) ########## 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: in big data: 1.[Presto](https://prestodb.io/docs/current/sql/show-catalogs.html), There is no output information in the link, but actual output is just `name` 2.[Flink](https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/dev/table/sql/show/#run-a-show-statement). in RDBMS The catalog layer is not strictly implemented in RDS 1.In PG, Catalog(=database).Schema(namespace).Table, So `show catalogs` == `show databases`; Unfortunately, pg doesn't have this command. we should use `select statement` instead of `show` command. [difference-between-a-catalog-and-a-schema-in-a-relational-database](https://stackoverflow.com/questions/7022755/whats-the-difference-between-a-catalog-and-a-schema-in-a-relational-database) 2.In MySQL, There is no catalog, just schema(database).table. So we can create a database use create schema/database xxx 3.In Oracle,The is no catalog, if we want access metadata, we can use select statement. [Link](https://en.wikipedia.org/wiki/Oracle_metadata ) -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org