-
Notifications
You must be signed in to change notification settings - Fork 752
Expand file tree
/
Copy pathshow.slt
More file actions
251 lines (198 loc) · 4.47 KB
/
show.slt
File metadata and controls
251 lines (198 loc) · 4.47 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
statement ok
create table if not exists t3 (v1 int, v2 int, v3 int) append only;
statement ok
create materialized view mv3 as select sum(v1) as sum_v1 from t3;
statement ok
create view v3 as select sum(v2) as sum_v2 from t3;
statement ok
comment on table t3 is 'volutpat vitae';
statement ok
comment on column t3.v1 is 'turpis vehicula';
statement ok
comment on column t3.v2 is 'Lorem ipsum dolor sit amet';
statement ok
comment on column public.t3._row_id is 'consectetur adipiscing elit';
query TTTT
describe t3;
----
v1 integer false turpis vehicula
v2 integer false Lorem ipsum dolor sit amet
v3 integer false NULL
_row_id serial true consectetur adipiscing elit
primary key _row_id NULL NULL
distribution key _row_id NULL NULL
table description t3 NULL volutpat vitae
query TTT
show columns from t3;
----
v1 integer false turpis vehicula
v2 integer false Lorem ipsum dolor sit amet
v3 integer false NULL
_row_id serial true consectetur adipiscing elit
statement ok
create index idx1 on t3 (v1,v2);
query TTTTT
show indexes from t3;
----
idx1 t3 v1 ASC, v2 ASC v3 v1
statement ok
comment on table public.t3 is 'consectetur turpis';
statement ok
comment on column t3.v1 is 'Nemo enim ipsam';
statement ok
comment on column t3.v2 is '';
statement ok
comment on column t3._row_id is NULL;
query TTTT
describe t3;
----
v1 integer false Nemo enim ipsam
v2 integer false NULL
v3 integer false NULL
_row_id serial true NULL
primary key _row_id NULL NULL
distribution key _row_id NULL NULL
idx1 index(v1 ASC, v2 ASC) include(v3) distributed by(v1) NULL NULL
table description t3 NULL consectetur turpis
query TT
show create index idx1;
----
public.idx1 CREATE INDEX idx1 ON t3(v1, v2)
statement ok
drop index idx1;
query T
show databases;
----
dev
query T rowsort
show schemas;
----
information_schema
pg_catalog
public
rw_catalog
query T
show tables;
----
t3
query T
show tables from public;
----
t3
query T
show tables from public like 't_';
----
t3
query T
show tables from public like '_t';
----
query T
show views;
----
v3
query T
show views from public;
----
v3
query T
show materialized views from public;
----
mv3
query T
show materialized views;
----
mv3
query T
show sources;
----
# Show create objects.
# The `WITH` options should be preserved, and the `IF NOT EXISTS` clause should be omitted.
query TT
show create table t3;
----
public.t3 CREATE TABLE t3 (v1 INT, v2 INT, v3 INT) APPEND ONLY
query TT
show create materialized view mv3;
----
public.mv3 CREATE MATERIALIZED VIEW mv3 AS SELECT sum(v1) AS sum_v1 FROM t3
statement ok
create view v1 as select * from t3;
query TT
show create view v1;
----
public.v1 CREATE VIEW v1 AS SELECT * FROM t3
statement ok
drop materialized view mv3;
statement ok
drop view v3;
statement ok
drop view v1;
statement ok
CREATE SINK sink3 AS select * from t3 WITH (
connector = 'blackhole'
);
query TTTT
describe sink3;
----
v1 integer false NULL
v2 integer false NULL
v3 integer false NULL
t3._row_id serial true NULL
distribution key t3._row_id NULL NULL
table description sink3 NULL NULL
query TTTT
show columns from sink3;
----
v1 integer false NULL
v2 integer false NULL
v3 integer false NULL
t3._row_id serial true NULL
statement ok
drop sink sink3;
statement ok
drop table t3;
query TTTT
describe pg_matviews;
----
schemaname character varying false NULL
matviewname character varying false NULL
matviewowner integer false NULL
tablespace character varying false NULL
hasindexes boolean false NULL
ispopulated boolean false NULL
definition character varying false NULL
table description pg_matviews NULL NULL
query TTTT
show columns from pg_catalog.pg_matviews;
----
schemaname character varying false NULL
matviewname character varying false NULL
matviewowner integer false NULL
tablespace character varying false NULL
hasindexes boolean false NULL
ispopulated boolean false NULL
definition character varying false NULL
# show tables according to search path
statement ok
create schema show_another_schema;
statement ok
create table show_another_schema.t_another (v1 int);
statement ok
create table t4 (v1 int);
query T
show tables;
----
t4
statement ok
set search_path to show_another_schema, public;
query T
show tables;
----
t_another
t4
statement ok
drop table t4;
statement ok
drop table show_another_schema.t_another;
statement ok
drop schema show_another_schema;