spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiangxb1987 <...@git.apache.org>
Subject [GitHub] spark pull request #16373: [SPARK-18961][SQL] Support `SHOW TABLE EXTENDED ....
Date Wed, 28 Dec 2016 08:10:53 GMT
Github user jiangxb1987 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16373#discussion_r94004875
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
---
    @@ -619,18 +621,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("")
    +        val tableName = tableIdent.table
    +        val isTemp = catalog.isTemporaryTable(tableIdent)
    +        if (isExtended) {
    +          val information = catalog.getTempViewOrPermanentTableMetadata(tableIdent).toString
    +          Row(database, tableName, isTemp, s"${information}\n")
    --- End diff --
    
    I think only in this case, the output could contains multiple rows, and each row contains
multiple lines.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message