Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/16373#discussion_r105586710
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala ---
@@ -642,18 +644,34 @@ case class ShowTablesCommand(
// instead of calling tables in sparkSession.
val catalog = sparkSession.sessionState.catalog
val db = databaseName.getOrElse(catalog.getCurrentDatabase)
- val tables =
- tableIdentifierPattern.map(catalog.listTables(db,
_)).getOrElse(catalog.listTables(db))
- tables.map { tableIdent =>
- val database = tableIdent.database.getOrElse("")
- val tableName = tableIdent.table
- val isTemp = catalog.isTemporaryTable(tableIdent)
- if (isExtended) {
- val information =
catalog.getTempViewOrPermanentTableMetadata(tableIdent).toString
- Row(database, tableName, isTemp, s"${information}\n")
- } else {
- Row(database, tableName, isTemp)
+ if (partitionSpec.isEmpty) {
+ // Show the information of tables.
+ val tables =
+ tableIdentifierPattern.map(catalog.listTables(db,
_)).getOrElse(catalog.listTables(db))
+ tables.map { tableIdent =>
+ val database = tableIdent.database.getOrElse("")
--- End diff --
shall we get the current database?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]