aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/inline-table.sql.out
blob: 4e80f0bda551391145b96058251979db01af16ca (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
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
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 17


-- !query 0
select * from values ("one", 1)
-- !query 0 schema
struct<col1:string,col2:int>
-- !query 0 output
one	1


-- !query 1
select * from values ("one", 1) as data
-- !query 1 schema
struct<col1:string,col2:int>
-- !query 1 output
one	1


-- !query 2
select * from values ("one", 1) as data(a, b)
-- !query 2 schema
struct<a:string,b:int>
-- !query 2 output
one	1


-- !query 3
select * from values 1, 2, 3 as data(a)
-- !query 3 schema
struct<a:int>
-- !query 3 output
1
2
3


-- !query 4
select * from values ("one", 1), ("two", 2), ("three", null) as data(a, b)
-- !query 4 schema
struct<a:string,b:int>
-- !query 4 output
one	1
three	NULL
two	2


-- !query 5
select * from values ("one", null), ("two", null) as data(a, b)
-- !query 5 schema
struct<a:string,b:null>
-- !query 5 output
one	NULL
two	NULL


-- !query 6
select * from values ("one", 1), ("two", 2L) as data(a, b)
-- !query 6 schema
struct<a:string,b:bigint>
-- !query 6 output
one	1
two	2


-- !query 7
select * from values ("one", 1 + 0), ("two", 1 + 3L) as data(a, b)
-- !query 7 schema
struct<a:string,b:bigint>
-- !query 7 output
one	1
two	4


-- !query 8
select * from values ("one", array(0, 1)), ("two", array(2, 3)) as data(a, b)
-- !query 8 schema
struct<a:string,b:array<int>>
-- !query 8 output
one	[0,1]
two	[2,3]


-- !query 9
select * from values ("one", 2.0), ("two", 3.0D) as data(a, b)
-- !query 9 schema
struct<a:string,b:double>
-- !query 9 output
one	2.0
two	3.0


-- !query 10
select * from values ("one", rand(5)), ("two", 3.0D) as data(a, b)
-- !query 10 schema
struct<>
-- !query 10 output
org.apache.spark.sql.AnalysisException
cannot evaluate expression rand(5) in inline table definition; line 1 pos 29


-- !query 11
select * from values ("one", 2.0), ("two") as data(a, b)
-- !query 11 schema
struct<>
-- !query 11 output
org.apache.spark.sql.AnalysisException
expected 2 columns but found 1 columns in row 1; line 1 pos 14


-- !query 12
select * from values ("one", array(0, 1)), ("two", struct(1, 2)) as data(a, b)
-- !query 12 schema
struct<>
-- !query 12 output
org.apache.spark.sql.AnalysisException
incompatible types found in column b for inline table; line 1 pos 14


-- !query 13
select * from values ("one"), ("two") as data(a, b)
-- !query 13 schema
struct<>
-- !query 13 output
org.apache.spark.sql.AnalysisException
expected 2 columns but found 1 columns in row 0; line 1 pos 14


-- !query 14
select * from values ("one", random_not_exist_func(1)), ("two", 2) as data(a, b)
-- !query 14 schema
struct<>
-- !query 14 output
org.apache.spark.sql.AnalysisException
Undefined function: 'random_not_exist_func'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 29


-- !query 15
select * from values ("one", count(1)), ("two", 2) as data(a, b)
-- !query 15 schema
struct<>
-- !query 15 output
org.apache.spark.sql.AnalysisException
cannot evaluate expression count(1) in inline table definition; line 1 pos 29


-- !query 16
select * from values (timestamp('1991-12-06 00:00:00.0'), array(timestamp('1991-12-06 01:00:00.0'), timestamp('1991-12-06 12:00:00.0'))) as data(a, b)
-- !query 16 schema
struct<a:timestamp,b:array<timestamp>>
-- !query 16 output
1991-12-06 00:00:00	[1991-12-06 01:00:00.0,1991-12-06 12:00:00.0]