-
Notifications
You must be signed in to change notification settings - Fork 28k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into SPARK-17822
- Loading branch information
Showing
12 changed files
with
403 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
sql/core/src/test/resources/sql-tests/inputs/show_columns.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
CREATE DATABASE showdb; | ||
|
||
USE showdb; | ||
|
||
CREATE TABLE showcolumn1 (col1 int, `col 2` int); | ||
CREATE TABLE showcolumn2 (price int, qty int) partitioned by (year int, month int); | ||
CREATE TEMPORARY VIEW showColumn3 (col3 int, `col 4` int) USING parquet; | ||
CREATE GLOBAL TEMP VIEW showColumn4 AS SELECT 1 as col1, 'abc' as `col 5`; | ||
|
||
|
||
-- only table name | ||
SHOW COLUMNS IN showcolumn1; | ||
|
||
-- qualified table name | ||
SHOW COLUMNS IN showdb.showcolumn1; | ||
|
||
-- table name and database name | ||
SHOW COLUMNS IN showcolumn1 FROM showdb; | ||
|
||
-- partitioned table | ||
SHOW COLUMNS IN showcolumn2 IN showdb; | ||
|
||
-- Non-existent table. Raise an error in this case | ||
SHOW COLUMNS IN badtable FROM showdb; | ||
|
||
-- database in table identifier and database name in different case | ||
SHOW COLUMNS IN showdb.showcolumn1 from SHOWDB; | ||
|
||
-- different database name in table identifier and database name. | ||
-- Raise an error in this case. | ||
SHOW COLUMNS IN showdb.showcolumn1 FROM baddb; | ||
|
||
-- show column on temporary view | ||
SHOW COLUMNS IN showcolumn3; | ||
|
||
-- error temp view can't be qualified with a database | ||
SHOW COLUMNS IN showdb.showcolumn3; | ||
|
||
-- error temp view can't be qualified with a database | ||
SHOW COLUMNS IN showcolumn3 FROM showdb; | ||
|
||
-- error global temp view needs to be qualified | ||
SHOW COLUMNS IN showcolumn4; | ||
|
||
-- global temp view qualified with database | ||
SHOW COLUMNS IN global_temp.showcolumn4; | ||
|
||
-- global temp view qualified with database | ||
SHOW COLUMNS IN showcolumn4 FROM global_temp; | ||
|
||
DROP TABLE showcolumn1; | ||
DROP TABLE showColumn2; | ||
DROP VIEW showcolumn3; | ||
DROP VIEW global_temp.showcolumn4; | ||
|
||
use default; | ||
|
||
DROP DATABASE showdb; |
Oops, something went wrong.