aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out
blob: ce42c016a7100214304a15b992429a20ff40e63d (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
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
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 28


-- !query 0
select -100
-- !query 0 schema
struct<-100:int>
-- !query 0 output
-100


-- !query 1
select +230
-- !query 1 schema
struct<230:int>
-- !query 1 output
230


-- !query 2
select -5.2
-- !query 2 schema
struct<-5.2:decimal(2,1)>
-- !query 2 output
-5.2


-- !query 3
select +6.8e0
-- !query 3 schema
struct<6.8:decimal(2,1)>
-- !query 3 output
6.8


-- !query 4
select -key, +key from testdata where key = 2
-- !query 4 schema
struct<(- key):int,key:int>
-- !query 4 output
-2	2


-- !query 5
select -(key + 1), - key + 1, +(key + 5) from testdata where key = 1
-- !query 5 schema
struct<(- (key + 1)):int,((- key) + 1):int,(key + 5):int>
-- !query 5 output
-2	0	6


-- !query 6
select -max(key), +max(key) from testdata
-- !query 6 schema
struct<(- max(key)):int,max(key):int>
-- !query 6 output
-100	100


-- !query 7
select - (-10)
-- !query 7 schema
struct<(- -10):int>
-- !query 7 output
10


-- !query 8
select + (-key) from testdata where key = 32
-- !query 8 schema
struct<(- key):int>
-- !query 8 output
-32


-- !query 9
select - (+max(key)) from testdata
-- !query 9 schema
struct<(- max(key)):int>
-- !query 9 output
-100


-- !query 10
select - - 3
-- !query 10 schema
struct<(- -3):int>
-- !query 10 output
3


-- !query 11
select - + 20
-- !query 11 schema
struct<(- 20):int>
-- !query 11 output
-20


-- !query 12
select + + 100
-- !query 12 schema
struct<100:int>
-- !query 12 output
100


-- !query 13
select - - max(key) from testdata
-- !query 13 schema
struct<(- (- max(key))):int>
-- !query 13 output
100


-- !query 14
select + - key from testdata where key = 33
-- !query 14 schema
struct<(- key):int>
-- !query 14 output
-33


-- !query 15
select 5 / 2
-- !query 15 schema
struct<(CAST(5 AS DOUBLE) / CAST(2 AS DOUBLE)):double>
-- !query 15 output
2.5


-- !query 16
select 5 / 0
-- !query 16 schema
struct<(CAST(5 AS DOUBLE) / CAST(0 AS DOUBLE)):double>
-- !query 16 output
NULL


-- !query 17
select 5 / null
-- !query 17 schema
struct<(CAST(5 AS DOUBLE) / CAST(NULL AS DOUBLE)):double>
-- !query 17 output
NULL


-- !query 18
select null / 5
-- !query 18 schema
struct<(CAST(NULL AS DOUBLE) / CAST(5 AS DOUBLE)):double>
-- !query 18 output
NULL


-- !query 19
select 5 div 2
-- !query 19 schema
struct<CAST((CAST(5 AS DOUBLE) / CAST(2 AS DOUBLE)) AS BIGINT):bigint>
-- !query 19 output
2


-- !query 20
select 5 div 0
-- !query 20 schema
struct<CAST((CAST(5 AS DOUBLE) / CAST(0 AS DOUBLE)) AS BIGINT):bigint>
-- !query 20 output
NULL


-- !query 21
select 5 div null
-- !query 21 schema
struct<CAST((CAST(5 AS DOUBLE) / CAST(NULL AS DOUBLE)) AS BIGINT):bigint>
-- !query 21 output
NULL


-- !query 22
select null div 5
-- !query 22 schema
struct<CAST((CAST(NULL AS DOUBLE) / CAST(5 AS DOUBLE)) AS BIGINT):bigint>
-- !query 22 output
NULL


-- !query 23
select 1 + 2
-- !query 23 schema
struct<(1 + 2):int>
-- !query 23 output
3


-- !query 24
select 1 - 2
-- !query 24 schema
struct<(1 - 2):int>
-- !query 24 output
-1


-- !query 25
select 2 * 5
-- !query 25 schema
struct<(2 * 5):int>
-- !query 25 output
10


-- !query 26
select 5 % 3
-- !query 26 schema
struct<(5 % 3):int>
-- !query 26 output
2


-- !query 27
select pmod(-7, 3)
-- !query 27 schema
struct<pmod(-7, 3):int>
-- !query 27 output
2