@@ -813,37 +813,6 @@ case class DescribeColumnCommand(
813813 }
814814}
815815
816- /**
817- * A command for users to get tables in the given database.
818- * If a databaseName is not given, the current database will be used.
819- * The syntax of using this command in SQL is:
820- * {{{
821- * SHOW TABLES [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards'];
822- * }}}
823- */
824- case class ShowTblsCommand (
825- databaseName : Option [String ], tableIdentifierPattern : Option [String ],
826- override val output : Seq [Attribute ]) extends RunnableCommand {
827- override def run (sparkSession : SparkSession ): Seq [Row ] = {
828- // Since we need to return a Seq of rows, we will call getTables directly
829- // instead of calling tables in sparkSession.
830- val catalog = sparkSession.sessionState.catalog
831- val db = databaseName.getOrElse(catalog.getCurrentDatabase)
832- // Show the information of tables.
833- val tables =
834- tableIdentifierPattern.map(catalog.listTables(db, _)).getOrElse(catalog.listTables(db))
835- tables.map { tableIdent =>
836- val database = tableIdent.database.getOrElse(" " )
837- val tableName = tableIdent.table
838- val isTemp = catalog.isTempView(tableIdent)
839- val catalogTable = catalog.getTempViewOrPermanentTableMetadata(tableIdent)
840- val isView = catalogTable.tableType == CatalogTableType .VIEW
841- Row (database, tableName, isTemp, isView)
842- }
843-
844- }
845- }
846-
847816/**
848817 * A command for users to get tables in the given database.
849818 * If a databaseName is not given, the current database will be used.
0 commit comments