yaooqinn commented on a change in pull request #31804:
URL: https://github.com/apache/spark/pull/31804#discussion_r592070614
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
##########
@@ -843,11 +843,22 @@ case class ShowTablesCommand(
val database = tableIdent.database.getOrElse("")
val tableName = tableIdent.table
val isTemp = catalog.isTempView(tableIdent)
+ val catalogTable =
catalog.getTempViewOrPermanentTableMetadata(tableIdent)
+ val isView = catalogTable.tableType == CatalogTableType.VIEW
if (isExtended) {
- val information =
catalog.getTempViewOrPermanentTableMetadata(tableIdent).simpleString
- Row(database, tableName, isTemp, s"$information\n")
+ val information = catalogTable.simpleString
+ if (output.size == 5) {
+ Row(database, tableName, isTemp, s"$information\n", isView)
+ } else {
+ Row(database, tableName, isTemp, s"$information\n")
+ }
} else {
- Row(database, tableName, isTemp)
+ if (output.size == 4) {
+ Row(database, tableName, isTemp, isView)
+ } else {
+ Row(database, tableName, isTemp)
Review comment:
yes, the new `show-tables-legacy.sql` will import the corresponding
tests to cover. I can add some cases in `v1.ShowTablesSuite` if
`show-tables-legacy.sql` is unintuitive
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]