Github user hvanhovell commented on a diff in the pull request: https://github.com/apache/spark/pull/15958#discussion_r89794720 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala --- @@ -589,30 +589,49 @@ case class DescribeTableCommand( * If a databaseName is not given, the current database will be used. * The syntax of using this command in SQL is: * {{{ - * SHOW TABLES [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards']; + * SHOW TABLES [EXTENDED] [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards']; * }}} */ case class ShowTablesCommand( databaseName: Option[String], - tableIdentifierPattern: Option[String]) extends RunnableCommand { + tableIdentifierPattern: Option[String], + isExtended: Boolean = false) extends RunnableCommand { - // The result of SHOW TABLES has three columns: database, tableName and isTemporary. + // The result of SHOW TABLES has three basic columns: database, tableName and isTemporary. + // If `isExtended` is true, append column `information` to the output columns. override val output: Seq[Attribute] = { + val tableExtendedInfo = if (isExtended) { + AttributeReference("information", StringType, nullable = false)() :: Nil + } else { + Nil + } AttributeReference("database", StringType, nullable = false)() :: AttributeReference("tableName", StringType, nullable = false)() :: - AttributeReference("isTemporary", BooleanType, nullable = false)() :: Nil + AttributeReference("isTemporary", BooleanType, nullable = false)() :: tableExtendedInfo } override def run(sparkSession: SparkSession): Seq[Row] = { + if (isExtended && !tableIdentifierPattern.isDefined) { + throw new AnalysisException( + s"SHOW TABLES EXTENDED must have identifier_with_wildcards specified.") --- End diff -- Throw this exception when creating the class. This is to late.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org