Repository: spark
Updated Branches:
  refs/heads/master 4b88393cb -> ddd7f5e11


[SPARK-17642][SQL][FOLLOWUP] drop test tables and improve comments

## What changes were proposed in this pull request?

Drop test tables and improve comments.

## How was this patch tested?

Modified existing test.

Author: Zhenhua Wang <wangzhen...@huawei.com>

Closes #19213 from wzhfy/useless_comment.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/ddd7f5e1
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ddd7f5e1
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ddd7f5e1

Branch: refs/heads/master
Commit: ddd7f5e11d0d3bdb3b79d95af3396fba009c512e
Parents: 4b88393
Author: Zhenhua Wang <wangzhen...@huawei.com>
Authored: Thu Sep 14 23:14:21 2017 +0800
Committer: Wenchen Fan <wenc...@databricks.com>
Committed: Thu Sep 14 23:14:21 2017 +0800

----------------------------------------------------------------------
 .../spark/sql/execution/command/tables.scala    |  8 +---
 .../sql-tests/inputs/describe-table-column.sql  | 26 ++++++-----
 .../results/describe-table-column.sql.out       | 46 +++++++++++++++-----
 3 files changed, 53 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/ddd7f5e1/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
----------------------------------------------------------------------
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 da0c815..8d95ca6 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
@@ -632,8 +632,7 @@ case class DescribeTableCommand(
 }
 
 /**
- * A command to list the info for a column, including name, data type, column 
stats and comment.
- * This function creates a [[DescribeColumnCommand]] logical plan.
+ * A command to list the info for a column, including name, data type, comment 
and column stats.
  *
  * The syntax of using this command in SQL is:
  * {{{
@@ -809,8 +808,7 @@ case class ShowTablePropertiesCommand(table: 
TableIdentifier, propertyKey: Optio
 }
 
 /**
- * A command to list the column names for a table. This function creates a
- * [[ShowColumnsCommand]] logical plan.
+ * A command to list the column names for a table.
  *
  * The syntax of using this command in SQL is:
  * {{{
@@ -849,8 +847,6 @@ case class ShowColumnsCommand(
  * 1. If the command is called for a non partitioned table.
  * 2. If the partition spec refers to the columns that are not defined as 
partitioning columns.
  *
- * This function creates a [[ShowPartitionsCommand]] logical plan
- *
  * The syntax of using this command in SQL is:
  * {{{
  *   SHOW PARTITIONS [db_name.]table_name [PARTITION(partition_spec)]

http://git-wip-us.apache.org/repos/asf/spark/blob/ddd7f5e1/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql
----------------------------------------------------------------------
diff --git 
a/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql 
b/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql
index 24870de..a6ddcd9 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql
@@ -1,17 +1,17 @@
 -- Test temp table
-CREATE TEMPORARY VIEW desc_col_temp_table (key int COMMENT 'column_comment') 
USING PARQUET;
+CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment') 
USING PARQUET;
 
-DESC desc_col_temp_table key;
+DESC desc_col_temp_view key;
 
-DESC EXTENDED desc_col_temp_table key;
+DESC EXTENDED desc_col_temp_view key;
 
-DESC FORMATTED desc_col_temp_table key;
+DESC FORMATTED desc_col_temp_view key;
 
 -- Describe a column with qualified name
-DESC FORMATTED desc_col_temp_table desc_col_temp_table.key;
+DESC FORMATTED desc_col_temp_view desc_col_temp_view.key;
 
 -- Describe a non-existent column
-DESC desc_col_temp_table key1;
+DESC desc_col_temp_view key1;
 
 -- Test persistent table
 CREATE TABLE desc_col_table (key int COMMENT 'column_comment') USING PARQUET;
@@ -25,11 +25,17 @@ DESC EXTENDED desc_col_table key;
 DESC FORMATTED desc_col_table key;
 
 -- Test complex columns
-CREATE TABLE desc_col_complex_table (`a.b` int, col struct<x:int, y:string>) 
USING PARQUET;
+CREATE TABLE desc_complex_col_table (`a.b` int, col struct<x:int, y:string>) 
USING PARQUET;
 
-DESC FORMATTED desc_col_complex_table `a.b`;
+DESC FORMATTED desc_complex_col_table `a.b`;
 
-DESC FORMATTED desc_col_complex_table col;
+DESC FORMATTED desc_complex_col_table col;
 
 -- Describe a nested column
-DESC FORMATTED desc_col_complex_table col.x;
+DESC FORMATTED desc_complex_col_table col.x;
+
+DROP VIEW desc_col_temp_view;
+
+DROP TABLE desc_col_table;
+
+DROP TABLE desc_complex_col_table;

http://git-wip-us.apache.org/repos/asf/spark/blob/ddd7f5e1/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out
----------------------------------------------------------------------
diff --git 
a/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out 
b/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out
index a51eef7..30d0a2d 100644
--- 
a/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out
+++ 
b/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out
@@ -1,9 +1,9 @@
 -- Automatically generated by SQLQueryTestSuite
--- Number of queries: 15
+-- Number of queries: 18
 
 
 -- !query 0
-CREATE TEMPORARY VIEW desc_col_temp_table (key int COMMENT 'column_comment') 
USING PARQUET
+CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment') 
USING PARQUET
 -- !query 0 schema
 struct<>
 -- !query 0 output
@@ -11,7 +11,7 @@ struct<>
 
 
 -- !query 1
-DESC desc_col_temp_table key
+DESC desc_col_temp_view key
 -- !query 1 schema
 struct<info_name:string,info_value:string>
 -- !query 1 output
@@ -21,7 +21,7 @@ comment       column_comment
 
 
 -- !query 2
-DESC EXTENDED desc_col_temp_table key
+DESC EXTENDED desc_col_temp_view key
 -- !query 2 schema
 struct<info_name:string,info_value:string>
 -- !query 2 output
@@ -37,7 +37,7 @@ max_col_len   NULL
 
 
 -- !query 3
-DESC FORMATTED desc_col_temp_table key
+DESC FORMATTED desc_col_temp_view key
 -- !query 3 schema
 struct<info_name:string,info_value:string>
 -- !query 3 output
@@ -53,7 +53,7 @@ max_col_len   NULL
 
 
 -- !query 4
-DESC FORMATTED desc_col_temp_table desc_col_temp_table.key
+DESC FORMATTED desc_col_temp_view desc_col_temp_view.key
 -- !query 4 schema
 struct<info_name:string,info_value:string>
 -- !query 4 output
@@ -69,7 +69,7 @@ max_col_len   NULL
 
 
 -- !query 5
-DESC desc_col_temp_table key1
+DESC desc_col_temp_view key1
 -- !query 5 schema
 struct<>
 -- !query 5 output
@@ -136,7 +136,7 @@ max_col_len 4
 
 
 -- !query 11
-CREATE TABLE desc_col_complex_table (`a.b` int, col struct<x:int, y:string>) 
USING PARQUET
+CREATE TABLE desc_complex_col_table (`a.b` int, col struct<x:int, y:string>) 
USING PARQUET
 -- !query 11 schema
 struct<>
 -- !query 11 output
@@ -144,7 +144,7 @@ struct<>
 
 
 -- !query 12
-DESC FORMATTED desc_col_complex_table `a.b`
+DESC FORMATTED desc_complex_col_table `a.b`
 -- !query 12 schema
 struct<info_name:string,info_value:string>
 -- !query 12 output
@@ -160,7 +160,7 @@ max_col_len NULL
 
 
 -- !query 13
-DESC FORMATTED desc_col_complex_table col
+DESC FORMATTED desc_complex_col_table col
 -- !query 13 schema
 struct<info_name:string,info_value:string>
 -- !query 13 output
@@ -176,9 +176,33 @@ max_col_len        NULL
 
 
 -- !query 14
-DESC FORMATTED desc_col_complex_table col.x
+DESC FORMATTED desc_complex_col_table col.x
 -- !query 14 schema
 struct<>
 -- !query 14 output
 org.apache.spark.sql.AnalysisException
 DESC TABLE COLUMN command does not support nested data types: col.x;
+
+
+-- !query 15
+DROP VIEW desc_col_temp_view
+-- !query 15 schema
+struct<>
+-- !query 15 output
+
+
+
+-- !query 16
+DROP TABLE desc_col_table
+-- !query 16 schema
+struct<>
+-- !query 16 output
+
+
+
+-- !query 17
+DROP TABLE desc_complex_col_table
+-- !query 17 schema
+struct<>
+-- !query 17 output
+


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to