Eric5553 commented on a change in pull request #27897: [SPARK-31113][SQL] Add 
SHOW VIEWS command

 File path: 
 @@ -295,6 +295,41 @@ case class AlterViewAsCommand(
+ * A command for users to get views in the given database.
+ * If a databaseName is not given, the current database will be used.
+ * The syntax of using this command in SQL is:
+ * {{{
+ *   SHOW VIEWS [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards'];
+ * }}}
+ */
+case class ShowViewsCommand(
+    databaseName: Option[String],
+    tableIdentifierPattern: Option[String]) extends RunnableCommand {
+  // The result of SHOW VIEWS has three basic columns: database, viewName and 
+  override val output: Seq[Attribute] = Seq(
+    AttributeReference("database", StringType, nullable = false)(),
 Review comment:
   Currently `VIEW` related commands are only supported in `v1 SessionCatalog`, 
maybe we can keep it along with V1 abstraction? The `SHOW TABLES` will resolve 
to v2 `ShowTablesExec` which use attrName `namespace`, while in the v1 version 
`ShowTablesCommand` it still using attrName `database`.  WDYT @cloud-fan , I'm 
OK with both decision  :-)

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:

With regards,
Apache Git Services

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to