aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/inputs/show-tables.sql
blob: a16c39819afe8590070fe74a2f7f5ce48d0a632d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- Test data.
CREATE DATABASE showdb;
USE showdb;
CREATE TABLE show_t1(a String, b Int) PARTITIONED BY (c String, d String);
ALTER TABLE show_t1 ADD PARTITION (c='Us', d=1);
CREATE TABLE show_t2(b String, d Int);
CREATE TEMPORARY VIEW show_t3(e int) USING parquet;
CREATE GLOBAL TEMP VIEW show_t4 AS SELECT 1 as col1;

-- SHOW TABLES
SHOW TABLES;
SHOW TABLES IN showdb;

-- SHOW TABLES WITH wildcard match
SHOW TABLES 'show_t*';
SHOW TABLES LIKE 'show_t1*|show_t2*';
SHOW TABLES IN showdb 'show_t*';

-- SHOW TABLES 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');

-- Clean Up
DROP TABLE show_t1;
DROP TABLE show_t2;
DROP VIEW  show_t3;
DROP VIEW  global_temp.show_t4;
USE default;
DROP DATABASE showdb;