diff options
author | jiangxingbo <jiangxb1987@gmail.com> | 2016-12-13 19:04:34 +0100 |
---|---|---|
committer | Herman van Hovell <hvanhovell@databricks.com> | 2016-12-13 19:04:34 +0100 |
commit | 5572ccf86b084eb5938fe62fd5d9973ec14d555d (patch) | |
tree | 6972e57022603e08687a2f2a4dcb1ae955ffefa5 /sql/core/src/test/resources/sql-tests | |
parent | f280ccf449f62a00eb4042dfbcf7a0715850fd4c (diff) | |
download | spark-5572ccf86b084eb5938fe62fd5d9973ec14d555d.tar.gz spark-5572ccf86b084eb5938fe62fd5d9973ec14d555d.tar.bz2 spark-5572ccf86b084eb5938fe62fd5d9973ec14d555d.zip |
[SPARK-17932][SQL][FOLLOWUP] Change statement `SHOW TABLES EXTENDED` to `SHOW TABLE EXTENDED`
## What changes were proposed in this pull request?
Change the statement `SHOW TABLES [EXTENDED] [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards'] [PARTITION(partition_spec)]` to the following statements:
- SHOW TABLES [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards']
- SHOW TABLE EXTENDED [(IN|FROM) database_name] LIKE 'identifier_with_wildcards' [PARTITION(partition_spec)]
After this change, the statements `SHOW TABLE/SHOW TABLES` have the same syntax with that HIVE has.
## How was this patch tested?
Modified the test sql file `show-tables.sql`;
Modified the test suite `DDLSuite`.
Author: jiangxingbo <jiangxb1987@gmail.com>
Closes #16262 from jiangxb1987/show-table-extended.
Diffstat (limited to 'sql/core/src/test/resources/sql-tests')
-rw-r--r-- | sql/core/src/test/resources/sql-tests/inputs/show-tables.sql | 8 | ||||
-rw-r--r-- | sql/core/src/test/resources/sql-tests/results/show-tables.sql.out | 14 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sql/core/src/test/resources/sql-tests/inputs/show-tables.sql b/sql/core/src/test/resources/sql-tests/inputs/show-tables.sql index a16c39819a..18d02e150e 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/show-tables.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/show-tables.sql @@ -16,11 +16,11 @@ SHOW TABLES 'show_t*'; SHOW TABLES LIKE 'show_t1*|show_t2*'; SHOW TABLES IN showdb 'show_t*'; --- SHOW TABLES EXTENDED +-- SHOW TABLE EXTENDED -- Ignore these because there exist timestamp results, e.g. `Created`. --- SHOW TABLES EXTENDED LIKE 'show_t*'; -SHOW TABLES EXTENDED; -SHOW TABLES EXTENDED LIKE 'show_t1' PARTITION(c='Us'); +-- SHOW TABLE EXTENDED LIKE 'show_t*'; +SHOW TABLE EXTENDED; +SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(c='Us'); -- Clean Up DROP TABLE show_t1; diff --git a/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out b/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out index a4f411258d..904601bf11 100644 --- a/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out @@ -114,28 +114,30 @@ show_t3 -- !query 12 -SHOW TABLES EXTENDED +SHOW TABLE EXTENDED -- !query 12 schema struct<> -- !query 12 output org.apache.spark.sql.catalyst.parser.ParseException -SHOW TABLES EXTENDED must have identifier_with_wildcards specified. +mismatched input '<EOF>' expecting 'LIKE'(line 1, pos 19) + == SQL == -SHOW TABLES EXTENDED +SHOW TABLE EXTENDED +-------------------^^^ -- !query 13 -SHOW TABLES EXTENDED LIKE 'show_t1' PARTITION(c='Us') +SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(c='Us') -- !query 13 schema struct<> -- !query 13 output org.apache.spark.sql.catalyst.parser.ParseException -Operation not allowed: SHOW TABLES [EXTENDED] ... PARTITION(line 1, pos 0) +Operation not allowed: SHOW TABLE EXTENDED ... PARTITION(line 1, pos 0) == SQL == -SHOW TABLES EXTENDED LIKE 'show_t1' PARTITION(c='Us') +SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(c='Us') ^^^ |