-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
describe.slt
88 lines (70 loc) · 2.45 KB
/
describe.slt
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
##########
# Describe internal tables when information_schema is true
##########
statement ok
set datafusion.catalog.information_schema = true
statement ok
CREATE external table aggregate_simple(c1 real, c2 double, c3 boolean) STORED as CSV WITH HEADER ROW LOCATION '../core/tests/data/aggregate_simple.csv';
query TTT rowsort
DESCRIBE aggregate_simple;
----
c1 Float32 YES
c2 Float64 YES
c3 Boolean YES
statement ok
DROP TABLE aggregate_simple;
##########
# Describe internal tables when information_schema is false
##########
statement ok
set datafusion.catalog.information_schema = false
statement ok
CREATE external table aggregate_simple(c1 real, c2 double, c3 boolean) STORED as CSV WITH HEADER ROW LOCATION '../core/tests/data/aggregate_simple.csv';
query TTT rowsort
DESCRIBE aggregate_simple;
----
c1 Float32 YES
c2 Float64 YES
c3 Boolean YES
statement ok
DROP TABLE aggregate_simple;
##########
# Describe file (currently we can only describe file in datafusion-cli, fix this after issue (#4850) has been done)
##########
statement error Error during planning: table 'datafusion.public.../core/tests/data/aggregate_simple.csv' not found
DESCRIBE '../core/tests/data/aggregate_simple.csv';
##########
# Describe command
##########
statement ok
CREATE EXTERNAL TABLE alltypes_tiny_pages STORED AS PARQUET LOCATION '../../parquet-testing/data/alltypes_tiny_pages.parquet';
query TTT
describe alltypes_tiny_pages;
----
id Int32 YES
bool_col Boolean YES
tinyint_col Int8 YES
smallint_col Int16 YES
int_col Int32 YES
bigint_col Int64 YES
float_col Float32 YES
double_col Float64 YES
date_string_col Utf8 YES
string_col Utf8 YES
timestamp_col Timestamp(Nanosecond, None) YES
year Int32 YES
month Int32 YES