|
1 | 1 | -- Automatically generated by SQLQueryTestSuite |
2 | | --- Number of queries: 36 |
| 2 | +-- Number of queries: 38 |
3 | 3 |
|
4 | 4 |
|
5 | 5 | -- !query 0 |
@@ -114,190 +114,206 @@ struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.00000000000000000 |
114 | 114 |
|
115 | 115 |
|
116 | 116 | -- !query 13 |
117 | | -select (5e36 + 0.1) + 5e36 |
| 117 | +select 2.35E10 * 1.0 |
118 | 118 | -- !query 13 schema |
119 | | -struct<(CAST((CAST(5E+36 AS DECIMAL(38,1)) + CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) + CAST(5E+36 AS DECIMAL(38,1))):decimal(38,1)> |
| 119 | +struct<(CAST(2.35E+10 AS DECIMAL(12,1)) * CAST(1.0 AS DECIMAL(12,1))):decimal(6,-7)> |
120 | 120 | -- !query 13 output |
121 | | -NULL |
| 121 | +23500000000 |
122 | 122 |
|
123 | 123 |
|
124 | 124 | -- !query 14 |
125 | | -select (-4e36 - 0.1) - 7e36 |
| 125 | +select (5e36 + 0.1) + 5e36 |
126 | 126 | -- !query 14 schema |
127 | | -struct<(CAST((CAST(-4E+36 AS DECIMAL(38,1)) - CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) - CAST(7E+36 AS DECIMAL(38,1))):decimal(38,1)> |
| 127 | +struct<(CAST((CAST(5E+36 AS DECIMAL(38,1)) + CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) + CAST(5E+36 AS DECIMAL(38,1))):decimal(38,1)> |
128 | 128 | -- !query 14 output |
129 | 129 | NULL |
130 | 130 |
|
131 | 131 |
|
132 | 132 | -- !query 15 |
133 | | -select 12345678901234567890.0 * 12345678901234567890.0 |
| 133 | +select (-4e36 - 0.1) - 7e36 |
134 | 134 | -- !query 15 schema |
135 | | -struct<(12345678901234567890.0 * 12345678901234567890.0):decimal(38,2)> |
| 135 | +struct<(CAST((CAST(-4E+36 AS DECIMAL(38,1)) - CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) - CAST(7E+36 AS DECIMAL(38,1))):decimal(38,1)> |
136 | 136 | -- !query 15 output |
137 | 137 | NULL |
138 | 138 |
|
139 | 139 |
|
140 | 140 | -- !query 16 |
141 | | -select 1e35 / 0.1 |
| 141 | +select 12345678901234567890.0 * 12345678901234567890.0 |
142 | 142 | -- !query 16 schema |
143 | | -struct<(CAST(1E+35 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,6)> |
| 143 | +struct<(12345678901234567890.0 * 12345678901234567890.0):decimal(38,2)> |
144 | 144 | -- !query 16 output |
145 | 145 | NULL |
146 | 146 |
|
147 | 147 |
|
148 | 148 | -- !query 17 |
149 | | -select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 |
| 149 | +select 1e35 / 0.1 |
150 | 150 | -- !query 17 schema |
151 | | -struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,6)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,6))):decimal(38,6)> |
| 151 | +struct<(CAST(1E+35 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,6)> |
152 | 152 | -- !query 17 output |
153 | | -10012345678912345678912345678911.246907 |
| 153 | +NULL |
154 | 154 |
|
155 | 155 |
|
156 | 156 | -- !query 18 |
157 | | -select 123456789123456789.1234567890 * 1.123456789123456789 |
| 157 | +select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 |
158 | 158 | -- !query 18 schema |
159 | | -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> |
| 159 | +struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,6)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,6))):decimal(38,6)> |
160 | 160 | -- !query 18 output |
161 | | -138698367904130467.654320988515622621 |
| 161 | +10012345678912345678912345678911.246907 |
162 | 162 |
|
163 | 163 |
|
164 | 164 | -- !query 19 |
165 | | -select 12345678912345.123456789123 / 0.000000012345678 |
| 165 | +select 123456789123456789.1234567890 * 1.123456789123456789 |
166 | 166 | -- !query 19 schema |
167 | | -struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,9)> |
| 167 | +struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> |
168 | 168 | -- !query 19 output |
169 | | -1000000073899961059796.725866332 |
| 169 | +138698367904130467.654320988515622621 |
170 | 170 |
|
171 | 171 |
|
172 | 172 | -- !query 20 |
173 | | -set spark.sql.decimalOperations.allowPrecisionLoss=false |
| 173 | +select 12345678912345.123456789123 / 0.000000012345678 |
174 | 174 | -- !query 20 schema |
175 | | -struct<key:string,value:string> |
| 175 | +struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,9)> |
176 | 176 | -- !query 20 output |
177 | | -spark.sql.decimalOperations.allowPrecisionLoss false |
| 177 | +1000000073899961059796.725866332 |
178 | 178 |
|
179 | 179 |
|
180 | 180 | -- !query 21 |
181 | | -select id, a+b, a-b, a*b, a/b from decimals_test order by id |
| 181 | +set spark.sql.decimalOperations.allowPrecisionLoss=false |
182 | 182 | -- !query 21 schema |
183 | | -struct<id:int,(a + b):decimal(38,18),(a - b):decimal(38,18),(a * b):decimal(38,36),(a / b):decimal(38,18)> |
| 183 | +struct<key:string,value:string> |
184 | 184 | -- !query 21 output |
| 185 | +spark.sql.decimalOperations.allowPrecisionLoss false |
| 186 | + |
| 187 | + |
| 188 | +-- !query 22 |
| 189 | +select id, a+b, a-b, a*b, a/b from decimals_test order by id |
| 190 | +-- !query 22 schema |
| 191 | +struct<id:int,(a + b):decimal(38,18),(a - b):decimal(38,18),(a * b):decimal(38,36),(a / b):decimal(38,18)> |
| 192 | +-- !query 22 output |
185 | 193 | 1 1099 -899 NULL 0.1001001001001001 |
186 | 194 | 2 24690.246 0 NULL 1 |
187 | 195 | 3 1234.2234567891011 -1233.9765432108989 NULL 0.000100037913541123 |
188 | 196 | 4 123456789123456790.123456789123456789 123456789123456787.876543210876543211 NULL 109890109097814272.043109406191131436 |
189 | 197 |
|
190 | 198 |
|
191 | | --- !query 22 |
| 199 | +-- !query 23 |
192 | 200 | select id, a*10, b/10 from decimals_test order by id |
193 | | --- !query 22 schema |
| 201 | +-- !query 23 schema |
194 | 202 | struct<id:int,(CAST(a AS DECIMAL(38,18)) * CAST(CAST(10 AS DECIMAL(2,0)) AS DECIMAL(38,18))):decimal(38,18),(CAST(b AS DECIMAL(38,18)) / CAST(CAST(10 AS DECIMAL(2,0)) AS DECIMAL(38,18))):decimal(38,19)> |
195 | | --- !query 22 output |
| 203 | +-- !query 23 output |
196 | 204 | 1 1000 99.9 |
197 | 205 | 2 123451.23 1234.5123 |
198 | 206 | 3 1.234567891011 123.41 |
199 | 207 | 4 1234567891234567890 0.1123456789123456789 |
200 | 208 |
|
201 | 209 |
|
202 | | --- !query 23 |
203 | | -select 10.3 * 3.0 |
204 | | --- !query 23 schema |
205 | | -struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> |
206 | | --- !query 23 output |
207 | | -30.9 |
208 | | - |
209 | | - |
210 | 210 | -- !query 24 |
211 | | -select 10.3000 * 3.0 |
| 211 | +select 10.3 * 3.0 |
212 | 212 | -- !query 24 schema |
213 | | -struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> |
| 213 | +struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> |
214 | 214 | -- !query 24 output |
215 | 215 | 30.9 |
216 | 216 |
|
217 | 217 |
|
218 | 218 | -- !query 25 |
219 | | -select 10.30000 * 30.0 |
| 219 | +select 10.3000 * 3.0 |
220 | 220 | -- !query 25 schema |
221 | | -struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> |
| 221 | +struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> |
222 | 222 | -- !query 25 output |
223 | | -309 |
| 223 | +30.9 |
224 | 224 |
|
225 | 225 |
|
226 | 226 | -- !query 26 |
227 | | -select 10.300000000000000000 * 3.000000000000000000 |
| 227 | +select 10.30000 * 30.0 |
228 | 228 | -- !query 26 schema |
229 | | -struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,36)> |
| 229 | +struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> |
230 | 230 | -- !query 26 output |
231 | | -30.9 |
| 231 | +309 |
232 | 232 |
|
233 | 233 |
|
234 | 234 | -- !query 27 |
235 | | -select 10.300000000000000000 * 3.0000000000000000000 |
| 235 | +select 10.300000000000000000 * 3.000000000000000000 |
236 | 236 | -- !query 27 schema |
237 | | -struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,37)> |
| 237 | +struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,36)> |
238 | 238 | -- !query 27 output |
239 | | -NULL |
| 239 | +30.9 |
240 | 240 |
|
241 | 241 |
|
242 | 242 | -- !query 28 |
243 | | -select (5e36 + 0.1) + 5e36 |
| 243 | +select 10.300000000000000000 * 3.0000000000000000000 |
244 | 244 | -- !query 28 schema |
245 | | -struct<(CAST((CAST(5E+36 AS DECIMAL(38,1)) + CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) + CAST(5E+36 AS DECIMAL(38,1))):decimal(38,1)> |
| 245 | +struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,37)> |
246 | 246 | -- !query 28 output |
247 | 247 | NULL |
248 | 248 |
|
249 | 249 |
|
250 | 250 | -- !query 29 |
251 | | -select (-4e36 - 0.1) - 7e36 |
| 251 | +select 2.35E10 * 1.0 |
252 | 252 | -- !query 29 schema |
253 | | -struct<(CAST((CAST(-4E+36 AS DECIMAL(38,1)) - CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) - CAST(7E+36 AS DECIMAL(38,1))):decimal(38,1)> |
| 253 | +struct<(CAST(2.35E+10 AS DECIMAL(12,1)) * CAST(1.0 AS DECIMAL(12,1))):decimal(6,-7)> |
254 | 254 | -- !query 29 output |
255 | | -NULL |
| 255 | +23500000000 |
256 | 256 |
|
257 | 257 |
|
258 | 258 | -- !query 30 |
259 | | -select 12345678901234567890.0 * 12345678901234567890.0 |
| 259 | +select (5e36 + 0.1) + 5e36 |
260 | 260 | -- !query 30 schema |
261 | | -struct<(12345678901234567890.0 * 12345678901234567890.0):decimal(38,2)> |
| 261 | +struct<(CAST((CAST(5E+36 AS DECIMAL(38,1)) + CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) + CAST(5E+36 AS DECIMAL(38,1))):decimal(38,1)> |
262 | 262 | -- !query 30 output |
263 | 263 | NULL |
264 | 264 |
|
265 | 265 |
|
266 | 266 | -- !query 31 |
267 | | -select 1e35 / 0.1 |
| 267 | +select (-4e36 - 0.1) - 7e36 |
268 | 268 | -- !query 31 schema |
269 | | -struct<(CAST(1E+35 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,3)> |
| 269 | +struct<(CAST((CAST(-4E+36 AS DECIMAL(38,1)) - CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) - CAST(7E+36 AS DECIMAL(38,1))):decimal(38,1)> |
270 | 270 | -- !query 31 output |
271 | 271 | NULL |
272 | 272 |
|
273 | 273 |
|
274 | 274 | -- !query 32 |
275 | | -select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 |
| 275 | +select 12345678901234567890.0 * 12345678901234567890.0 |
276 | 276 | -- !query 32 schema |
277 | | -struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,7)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,7))):decimal(38,7)> |
| 277 | +struct<(12345678901234567890.0 * 12345678901234567890.0):decimal(38,2)> |
278 | 278 | -- !query 32 output |
279 | 279 | NULL |
280 | 280 |
|
281 | 281 |
|
282 | 282 | -- !query 33 |
283 | | -select 123456789123456789.1234567890 * 1.123456789123456789 |
| 283 | +select 1e35 / 0.1 |
284 | 284 | -- !query 33 schema |
285 | | -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,28)> |
| 285 | +struct<(CAST(1E+35 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,3)> |
286 | 286 | -- !query 33 output |
287 | 287 | NULL |
288 | 288 |
|
289 | 289 |
|
290 | 290 | -- !query 34 |
291 | | -select 12345678912345.123456789123 / 0.000000012345678 |
| 291 | +select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 |
292 | 292 | -- !query 34 schema |
293 | | -struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,18)> |
| 293 | +struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,7)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,7))):decimal(38,7)> |
294 | 294 | -- !query 34 output |
295 | 295 | NULL |
296 | 296 |
|
297 | 297 |
|
298 | 298 | -- !query 35 |
299 | | -drop table decimals_test |
| 299 | +select 123456789123456789.1234567890 * 1.123456789123456789 |
300 | 300 | -- !query 35 schema |
301 | | -struct<> |
| 301 | +struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,28)> |
302 | 302 | -- !query 35 output |
| 303 | +NULL |
| 304 | + |
| 305 | + |
| 306 | +-- !query 36 |
| 307 | +select 12345678912345.123456789123 / 0.000000012345678 |
| 308 | +-- !query 36 schema |
| 309 | +struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,18)> |
| 310 | +-- !query 36 output |
| 311 | +NULL |
| 312 | + |
| 313 | + |
| 314 | +-- !query 37 |
| 315 | +drop table decimals_test |
| 316 | +-- !query 37 schema |
| 317 | +struct<> |
| 318 | +-- !query 37 output |
303 | 319 |
|
0 commit comments