diff options
author | Xiao Li <gatorsmile@gmail.com> | 2017-03-22 19:08:28 +0800 |
---|---|---|
committer | Wenchen Fan <wenchen@databricks.com> | 2017-03-22 19:08:28 +0800 |
commit | 7343a09401e7d6636634968b1cd8bc403a1f77b6 (patch) | |
tree | 05e28a3a6016c186a1b7d553e1a1fcf6c8922d34 /sql/core/src/main | |
parent | 478fbc866fbfdb4439788583281863ecea14e8af (diff) | |
download | spark-7343a09401e7d6636634968b1cd8bc403a1f77b6.tar.gz spark-7343a09401e7d6636634968b1cd8bc403a1f77b6.tar.bz2 spark-7343a09401e7d6636634968b1cd8bc403a1f77b6.zip |
[SPARK-20023][SQL] Output table comment for DESC FORMATTED
### What changes were proposed in this pull request?
Currently, `DESC FORMATTED` did not output the table comment, unlike what `DESC EXTENDED` does. This PR is to fix it.
Also correct the following displayed names in `DESC FORMATTED`, for being consistent with `DESC EXTENDED`
- `"Create Time:"` -> `"Created:"`
- `"Last Access Time:"` -> `"Last Access:"`
### How was this patch tested?
Added test cases in `describe.sql`
Author: Xiao Li <gatorsmile@gmail.com>
Closes #17381 from gatorsmile/descFormattedTableComment.
Diffstat (limited to 'sql/core/src/main')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala index 93307fc883..c7aeef06a0 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala @@ -568,11 +568,12 @@ case class DescribeTableCommand( append(buffer, "# Detailed Table Information", "", "") append(buffer, "Database:", table.database, "") append(buffer, "Owner:", table.owner, "") - append(buffer, "Create Time:", new Date(table.createTime).toString, "") - append(buffer, "Last Access Time:", new Date(table.lastAccessTime).toString, "") + append(buffer, "Created:", new Date(table.createTime).toString, "") + append(buffer, "Last Access:", new Date(table.lastAccessTime).toString, "") append(buffer, "Location:", table.storage.locationUri.map(CatalogUtils.URIToString(_)) .getOrElse(""), "") append(buffer, "Table Type:", table.tableType.name, "") + append(buffer, "Comment:", table.comment.getOrElse(""), "") table.stats.foreach(s => append(buffer, "Statistics:", s.simpleString, "")) append(buffer, "Table Parameters:", "", "") |