|
1 | 1 | -- Automatically generated by SQLQueryTestSuite
|
2 |
| --- Number of queries: 32 |
| 2 | +-- Number of queries: 36 |
3 | 3 |
|
4 | 4 |
|
5 | 5 | -- !query 0
|
@@ -146,146 +146,158 @@ NULL
|
146 | 146 |
|
147 | 147 |
|
148 | 148 | -- !query 17
|
149 |
| -select 123456789123456789.1234567890 * 1.123456789123456789 |
| 149 | +select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 |
150 | 150 | -- !query 17 schema
|
151 |
| -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> |
| 151 | +struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,6)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,6))):decimal(38,6)> |
152 | 152 | -- !query 17 output
|
153 |
| -138698367904130467.654320988515622621 |
| 153 | +10012345678912345678912345678911.246907 |
154 | 154 |
|
155 | 155 |
|
156 | 156 | -- !query 18
|
157 |
| -select 0.001 / 9876543210987654321098765432109876543.2 |
158 |
| - |
159 |
| -set spark.sql.decimalOperations.allowPrecisionLoss=false |
| 157 | +select 123456789123456789.1234567890 * 1.123456789123456789 |
160 | 158 | -- !query 18 schema
|
161 |
| -struct<> |
| 159 | +struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> |
162 | 160 | -- !query 18 output
|
163 |
| -org.apache.spark.sql.catalyst.parser.ParseException |
164 |
| - |
165 |
| -mismatched input 'spark' expecting <EOF>(line 3, pos 4) |
166 |
| - |
167 |
| -== SQL == |
168 |
| -select 0.001 / 9876543210987654321098765432109876543.2 |
169 |
| - |
170 |
| -set spark.sql.decimalOperations.allowPrecisionLoss=false |
171 |
| -----^^^ |
| 161 | +138698367904130467.654320988515622621 |
172 | 162 |
|
173 | 163 |
|
174 | 164 | -- !query 19
|
175 |
| -select id, a+b, a-b, a*b, a/b from decimals_test order by id |
| 165 | +select 12345678912345.123456789123 / 0.000000012345678 |
176 | 166 | -- !query 19 schema
|
177 |
| -struct<id:int,(a + b):decimal(38,17),(a - b):decimal(38,17),(a * b):decimal(38,6),(a / b):decimal(38,6)> |
| 167 | +struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,9)> |
178 | 168 | -- !query 19 output
|
179 |
| -1 1099 -899 99900 0.1001 |
180 |
| -2 24690.246 0 152402061.885129 1 |
181 |
| -3 1234.2234567891011 -1233.9765432108989 152.358023 0.0001 |
182 |
| -4 123456789123456790.12345678912345679 123456789123456787.87654321087654321 138698367904130467.515623 109890109097814272.043109 |
| 169 | +1000000073899961059796.725866332 |
183 | 170 |
|
184 | 171 |
|
185 | 172 | -- !query 20
|
186 |
| -select id, a*10, b/10 from decimals_test order by id |
| 173 | +set spark.sql.decimalOperations.allowPrecisionLoss=false |
187 | 174 | -- !query 20 schema
|
188 |
| -struct<id:int,(CAST(a AS DECIMAL(38,18)) * CAST(CAST(10 AS DECIMAL(2,0)) AS DECIMAL(38,18))):decimal(38,15),(CAST(b AS DECIMAL(38,18)) / CAST(CAST(10 AS DECIMAL(2,0)) AS DECIMAL(38,18))):decimal(38,18)> |
| 175 | +struct<key:string,value:string> |
189 | 176 | -- !query 20 output
|
190 |
| -1 1000 99.9 |
191 |
| -2 123451.23 1234.5123 |
192 |
| -3 1.234567891011 123.41 |
193 |
| -4 1234567891234567890 0.112345678912345679 |
| 177 | +spark.sql.decimalOperations.allowPrecisionLoss false |
194 | 178 |
|
195 | 179 |
|
196 | 180 | -- !query 21
|
197 |
| -select 10.3 * 3.0 |
| 181 | +select id, a+b, a-b, a*b, a/b from decimals_test order by id |
198 | 182 | -- !query 21 schema
|
199 |
| -struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> |
| 183 | +struct<id:int,(a + b):decimal(38,18),(a - b):decimal(38,18),(a * b):decimal(38,36),(a / b):decimal(38,18)> |
200 | 184 | -- !query 21 output
|
201 |
| -30.9 |
| 185 | +1 1099 -899 NULL 0.1001001001001001 |
| 186 | +2 24690.246 0 NULL 1 |
| 187 | +3 1234.2234567891011 -1233.9765432108989 NULL 0.000100037913541123 |
| 188 | +4 123456789123456790.123456789123456789 123456789123456787.876543210876543211 NULL 109890109097814272.043109406191131436 |
202 | 189 |
|
203 | 190 |
|
204 | 191 | -- !query 22
|
205 |
| -select 10.3000 * 3.0 |
| 192 | +select id, a*10, b/10 from decimals_test order by id |
206 | 193 | -- !query 22 schema
|
207 |
| -struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> |
| 194 | +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)> |
208 | 195 | -- !query 22 output
|
209 |
| -30.9 |
| 196 | +1 1000 99.9 |
| 197 | +2 123451.23 1234.5123 |
| 198 | +3 1.234567891011 123.41 |
| 199 | +4 1234567891234567890 0.1123456789123456789 |
210 | 200 |
|
211 | 201 |
|
212 | 202 | -- !query 23
|
213 |
| -select 10.30000 * 30.0 |
| 203 | +select 10.3 * 3.0 |
214 | 204 | -- !query 23 schema
|
215 |
| -struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> |
| 205 | +struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> |
216 | 206 | -- !query 23 output
|
217 |
| -309 |
| 207 | +30.9 |
218 | 208 |
|
219 | 209 |
|
220 | 210 | -- !query 24
|
221 |
| -select 10.300000000000000000 * 3.000000000000000000 |
| 211 | +select 10.3000 * 3.0 |
222 | 212 | -- !query 24 schema
|
223 |
| -struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,34)> |
| 213 | +struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> |
224 | 214 | -- !query 24 output
|
225 | 215 | 30.9
|
226 | 216 |
|
227 | 217 |
|
228 | 218 | -- !query 25
|
229 |
| -select 10.300000000000000000 * 3.0000000000000000000 |
| 219 | +select 10.30000 * 30.0 |
230 | 220 | -- !query 25 schema
|
231 |
| -struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,34)> |
| 221 | +struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> |
232 | 222 | -- !query 25 output
|
233 |
| -30.9 |
| 223 | +309 |
234 | 224 |
|
235 | 225 |
|
236 | 226 | -- !query 26
|
237 |
| -select (5e36 + 0.1) + 5e36 |
| 227 | +select 10.300000000000000000 * 3.000000000000000000 |
238 | 228 | -- !query 26 schema
|
239 |
| -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)> |
| 229 | +struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,36)> |
240 | 230 | -- !query 26 output
|
241 |
| -NULL |
| 231 | +30.9 |
242 | 232 |
|
243 | 233 |
|
244 | 234 | -- !query 27
|
245 |
| -select (-4e36 - 0.1) - 7e36 |
| 235 | +select 10.300000000000000000 * 3.0000000000000000000 |
246 | 236 | -- !query 27 schema
|
247 |
| -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)> |
| 237 | +struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,37)> |
248 | 238 | -- !query 27 output
|
249 | 239 | NULL
|
250 | 240 |
|
251 | 241 |
|
252 | 242 | -- !query 28
|
253 |
| -select 12345678901234567890.0 * 12345678901234567890.0 |
| 243 | +select (5e36 + 0.1) + 5e36 |
254 | 244 | -- !query 28 schema
|
255 |
| -struct<(12345678901234567890.0 * 12345678901234567890.0):decimal(38,2)> |
| 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)> |
256 | 246 | -- !query 28 output
|
257 | 247 | NULL
|
258 | 248 |
|
259 | 249 |
|
260 | 250 | -- !query 29
|
261 |
| -select 1e35 / 0.1 |
| 251 | +select (-4e36 - 0.1) - 7e36 |
262 | 252 | -- !query 29 schema
|
263 |
| -struct<(CAST(1E+35 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,6)> |
| 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)> |
264 | 254 | -- !query 29 output
|
265 | 255 | NULL
|
266 | 256 |
|
267 | 257 |
|
268 | 258 | -- !query 30
|
269 |
| -select 123456789123456789.1234567890 * 1.123456789123456789 |
| 259 | +select 12345678901234567890.0 * 12345678901234567890.0 |
270 | 260 | -- !query 30 schema
|
271 |
| -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> |
| 261 | +struct<(12345678901234567890.0 * 12345678901234567890.0):decimal(38,2)> |
272 | 262 | -- !query 30 output
|
273 |
| -138698367904130467.654320988515622621 |
| 263 | +NULL |
274 | 264 |
|
275 | 265 |
|
276 | 266 | -- !query 31
|
277 |
| -select 0.001 / 9876543210987654321098765432109876543.2 |
278 |
| - |
279 |
| -drop table decimals_test |
| 267 | +select 1e35 / 0.1 |
280 | 268 | -- !query 31 schema
|
281 |
| -struct<> |
| 269 | +struct<(CAST(1E+35 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,3)> |
282 | 270 | -- !query 31 output
|
283 |
| -org.apache.spark.sql.catalyst.parser.ParseException |
| 271 | +NULL |
284 | 272 |
|
285 |
| -mismatched input 'table' expecting <EOF>(line 3, pos 5) |
286 | 273 |
|
287 |
| -== SQL == |
288 |
| -select 0.001 / 9876543210987654321098765432109876543.2 |
| 274 | +-- !query 32 |
| 275 | +select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 |
| 276 | +-- !query 32 schema |
| 277 | +struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,7)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,7))):decimal(38,7)> |
| 278 | +-- !query 32 output |
| 279 | +NULL |
| 280 | + |
| 281 | + |
| 282 | +-- !query 33 |
| 283 | +select 123456789123456789.1234567890 * 1.123456789123456789 |
| 284 | +-- !query 33 schema |
| 285 | +struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,28)> |
| 286 | +-- !query 33 output |
| 287 | +NULL |
| 288 | + |
289 | 289 |
|
| 290 | +-- !query 34 |
| 291 | +select 12345678912345.123456789123 / 0.000000012345678 |
| 292 | +-- !query 34 schema |
| 293 | +struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,18)> |
| 294 | +-- !query 34 output |
| 295 | +NULL |
| 296 | + |
| 297 | + |
| 298 | +-- !query 35 |
290 | 299 | drop table decimals_test
|
291 |
| ------^^^ |
| 300 | +-- !query 35 schema |
| 301 | +struct<> |
| 302 | +-- !query 35 output |
| 303 | + |
0 commit comments