Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Commit ddd7f5e

Browse files
wzhfycloud-fan
authored andcommitted
[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 <[email protected]> Closes apache#19213 from wzhfy/useless_comment.
1 parent 4b88393 commit ddd7f5e

File tree

3 files changed

+53
-27
lines changed

3 files changed

+53
-27
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,7 @@ case class DescribeTableCommand(
632632
}
633633

634634
/**
635-
* A command to list the info for a column, including name, data type, column stats and comment.
636-
* This function creates a [[DescribeColumnCommand]] logical plan.
635+
* A command to list the info for a column, including name, data type, comment and column stats.
637636
*
638637
* The syntax of using this command in SQL is:
639638
* {{{
@@ -809,8 +808,7 @@ case class ShowTablePropertiesCommand(table: TableIdentifier, propertyKey: Optio
809808
}
810809

811810
/**
812-
* A command to list the column names for a table. This function creates a
813-
* [[ShowColumnsCommand]] logical plan.
811+
* A command to list the column names for a table.
814812
*
815813
* The syntax of using this command in SQL is:
816814
* {{{
@@ -849,8 +847,6 @@ case class ShowColumnsCommand(
849847
* 1. If the command is called for a non partitioned table.
850848
* 2. If the partition spec refers to the columns that are not defined as partitioning columns.
851849
*
852-
* This function creates a [[ShowPartitionsCommand]] logical plan
853-
*
854850
* The syntax of using this command in SQL is:
855851
* {{{
856852
* SHOW PARTITIONS [db_name.]table_name [PARTITION(partition_spec)]
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
-- Test temp table
2-
CREATE TEMPORARY VIEW desc_col_temp_table (key int COMMENT 'column_comment') USING PARQUET;
2+
CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment') USING PARQUET;
33

4-
DESC desc_col_temp_table key;
4+
DESC desc_col_temp_view key;
55

6-
DESC EXTENDED desc_col_temp_table key;
6+
DESC EXTENDED desc_col_temp_view key;
77

8-
DESC FORMATTED desc_col_temp_table key;
8+
DESC FORMATTED desc_col_temp_view key;
99

1010
-- Describe a column with qualified name
11-
DESC FORMATTED desc_col_temp_table desc_col_temp_table.key;
11+
DESC FORMATTED desc_col_temp_view desc_col_temp_view.key;
1212

1313
-- Describe a non-existent column
14-
DESC desc_col_temp_table key1;
14+
DESC desc_col_temp_view key1;
1515

1616
-- Test persistent table
1717
CREATE TABLE desc_col_table (key int COMMENT 'column_comment') USING PARQUET;
@@ -25,11 +25,17 @@ DESC EXTENDED desc_col_table key;
2525
DESC FORMATTED desc_col_table key;
2626

2727
-- Test complex columns
28-
CREATE TABLE desc_col_complex_table (`a.b` int, col struct<x:int, y:string>) USING PARQUET;
28+
CREATE TABLE desc_complex_col_table (`a.b` int, col struct<x:int, y:string>) USING PARQUET;
2929

30-
DESC FORMATTED desc_col_complex_table `a.b`;
30+
DESC FORMATTED desc_complex_col_table `a.b`;
3131

32-
DESC FORMATTED desc_col_complex_table col;
32+
DESC FORMATTED desc_complex_col_table col;
3333

3434
-- Describe a nested column
35-
DESC FORMATTED desc_col_complex_table col.x;
35+
DESC FORMATTED desc_complex_col_table col.x;
36+
37+
DROP VIEW desc_col_temp_view;
38+
39+
DROP TABLE desc_col_table;
40+
41+
DROP TABLE desc_complex_col_table;

sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
-- Automatically generated by SQLQueryTestSuite
2-
-- Number of queries: 15
2+
-- Number of queries: 18
33

44

55
-- !query 0
6-
CREATE TEMPORARY VIEW desc_col_temp_table (key int COMMENT 'column_comment') USING PARQUET
6+
CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment') USING PARQUET
77
-- !query 0 schema
88
struct<>
99
-- !query 0 output
1010

1111

1212

1313
-- !query 1
14-
DESC desc_col_temp_table key
14+
DESC desc_col_temp_view key
1515
-- !query 1 schema
1616
struct<info_name:string,info_value:string>
1717
-- !query 1 output
@@ -21,7 +21,7 @@ comment column_comment
2121

2222

2323
-- !query 2
24-
DESC EXTENDED desc_col_temp_table key
24+
DESC EXTENDED desc_col_temp_view key
2525
-- !query 2 schema
2626
struct<info_name:string,info_value:string>
2727
-- !query 2 output
@@ -37,7 +37,7 @@ max_col_len NULL
3737

3838

3939
-- !query 3
40-
DESC FORMATTED desc_col_temp_table key
40+
DESC FORMATTED desc_col_temp_view key
4141
-- !query 3 schema
4242
struct<info_name:string,info_value:string>
4343
-- !query 3 output
@@ -53,7 +53,7 @@ max_col_len NULL
5353

5454

5555
-- !query 4
56-
DESC FORMATTED desc_col_temp_table desc_col_temp_table.key
56+
DESC FORMATTED desc_col_temp_view desc_col_temp_view.key
5757
-- !query 4 schema
5858
struct<info_name:string,info_value:string>
5959
-- !query 4 output
@@ -69,7 +69,7 @@ max_col_len NULL
6969

7070

7171
-- !query 5
72-
DESC desc_col_temp_table key1
72+
DESC desc_col_temp_view key1
7373
-- !query 5 schema
7474
struct<>
7575
-- !query 5 output
@@ -136,15 +136,15 @@ max_col_len 4
136136

137137

138138
-- !query 11
139-
CREATE TABLE desc_col_complex_table (`a.b` int, col struct<x:int, y:string>) USING PARQUET
139+
CREATE TABLE desc_complex_col_table (`a.b` int, col struct<x:int, y:string>) USING PARQUET
140140
-- !query 11 schema
141141
struct<>
142142
-- !query 11 output
143143

144144

145145

146146
-- !query 12
147-
DESC FORMATTED desc_col_complex_table `a.b`
147+
DESC FORMATTED desc_complex_col_table `a.b`
148148
-- !query 12 schema
149149
struct<info_name:string,info_value:string>
150150
-- !query 12 output
@@ -160,7 +160,7 @@ max_col_len NULL
160160

161161

162162
-- !query 13
163-
DESC FORMATTED desc_col_complex_table col
163+
DESC FORMATTED desc_complex_col_table col
164164
-- !query 13 schema
165165
struct<info_name:string,info_value:string>
166166
-- !query 13 output
@@ -176,9 +176,33 @@ max_col_len NULL
176176

177177

178178
-- !query 14
179-
DESC FORMATTED desc_col_complex_table col.x
179+
DESC FORMATTED desc_complex_col_table col.x
180180
-- !query 14 schema
181181
struct<>
182182
-- !query 14 output
183183
org.apache.spark.sql.AnalysisException
184184
DESC TABLE COLUMN command does not support nested data types: col.x;
185+
186+
187+
-- !query 15
188+
DROP VIEW desc_col_temp_view
189+
-- !query 15 schema
190+
struct<>
191+
-- !query 15 output
192+
193+
194+
195+
-- !query 16
196+
DROP TABLE desc_col_table
197+
-- !query 16 schema
198+
struct<>
199+
-- !query 16 output
200+
201+
202+
203+
-- !query 17
204+
DROP TABLE desc_complex_col_table
205+
-- !query 17 schema
206+
struct<>
207+
-- !query 17 output
208+

0 commit comments

Comments
 (0)