|
2 | 2 | -- Number of queries: 16 |
3 | 3 |
|
4 | 4 |
|
5 | | --- !query 0 |
| 5 | +-- !query |
6 | 6 | create table decimals_test(id int, a decimal(38,18), b decimal(38,18)) using parquet |
7 | | --- !query 0 schema |
| 7 | +-- !query schema |
8 | 8 | struct<> |
9 | | --- !query 0 output |
| 9 | +-- !query output |
10 | 10 |
|
11 | 11 |
|
12 | 12 |
|
13 | | --- !query 1 |
| 13 | +-- !query |
14 | 14 | insert into decimals_test values(1, 100.0, 999.0), (2, 12345.123, 12345.123), |
15 | 15 | (3, 0.1234567891011, 1234.1), (4, 123456789123456789.0, 1.123456789123456789) |
16 | | --- !query 1 schema |
| 16 | +-- !query schema |
17 | 17 | struct<> |
18 | | --- !query 1 output |
| 18 | +-- !query output |
19 | 19 |
|
20 | 20 |
|
21 | 21 |
|
22 | | --- !query 2 |
| 22 | +-- !query |
23 | 23 | select id, a*10, b/10 from decimals_test order by id |
24 | | --- !query 2 schema |
| 24 | +-- !query schema |
25 | 25 | 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)> |
26 | | --- !query 2 output |
| 26 | +-- !query output |
27 | 27 | 1 1000.000000000000000 99.900000000000000000 |
28 | 28 | 2 123451.230000000000000 1234.512300000000000000 |
29 | 29 | 3 1.234567891011000 123.410000000000000000 |
30 | 30 | 4 1234567891234567890.000000000000000 0.112345678912345679 |
31 | 31 |
|
32 | 32 |
|
33 | | --- !query 3 |
| 33 | +-- !query |
34 | 34 | select 10.3 * 3.0 |
35 | | --- !query 3 schema |
| 35 | +-- !query schema |
36 | 36 | struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> |
37 | | --- !query 3 output |
| 37 | +-- !query output |
38 | 38 | 30.90 |
39 | 39 |
|
40 | 40 |
|
41 | | --- !query 4 |
| 41 | +-- !query |
42 | 42 | select 10.3000 * 3.0 |
43 | | --- !query 4 schema |
| 43 | +-- !query schema |
44 | 44 | struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> |
45 | | --- !query 4 output |
| 45 | +-- !query output |
46 | 46 | 30.90000 |
47 | 47 |
|
48 | 48 |
|
49 | | --- !query 5 |
| 49 | +-- !query |
50 | 50 | select 10.30000 * 30.0 |
51 | | --- !query 5 schema |
| 51 | +-- !query schema |
52 | 52 | struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> |
53 | | --- !query 5 output |
| 53 | +-- !query output |
54 | 54 | 309.000000 |
55 | 55 |
|
56 | 56 |
|
57 | | --- !query 6 |
| 57 | +-- !query |
58 | 58 | select 10.300000000000000000 * 3.000000000000000000 |
59 | | --- !query 6 schema |
| 59 | +-- !query schema |
60 | 60 | struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,34)> |
61 | | --- !query 6 output |
| 61 | +-- !query output |
62 | 62 | 30.9000000000000000000000000000000000 |
63 | 63 |
|
64 | 64 |
|
65 | | --- !query 7 |
| 65 | +-- !query |
66 | 66 | select 10.300000000000000000 * 3.0000000000000000000 |
67 | | --- !query 7 schema |
| 67 | +-- !query schema |
68 | 68 | struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,34)> |
69 | | --- !query 7 output |
| 69 | +-- !query output |
70 | 70 | 30.9000000000000000000000000000000000 |
71 | 71 |
|
72 | 72 |
|
73 | | --- !query 8 |
| 73 | +-- !query |
74 | 74 | select (5e36BD + 0.1) + 5e36BD |
75 | | --- !query 8 schema |
| 75 | +-- !query schema |
76 | 76 | struct<> |
77 | | --- !query 8 output |
| 77 | +-- !query output |
78 | 78 | java.lang.ArithmeticException |
79 | 79 | Decimal(expanded,10000000000000000000000000000000000000.1,39,1}) cannot be represented as Decimal(38, 1). |
80 | 80 |
|
81 | 81 |
|
82 | | --- !query 9 |
| 82 | +-- !query |
83 | 83 | select (-4e36BD - 0.1) - 7e36BD |
84 | | --- !query 9 schema |
| 84 | +-- !query schema |
85 | 85 | struct<> |
86 | | --- !query 9 output |
| 86 | +-- !query output |
87 | 87 | java.lang.ArithmeticException |
88 | 88 | Decimal(expanded,-11000000000000000000000000000000000000.1,39,1}) cannot be represented as Decimal(38, 1). |
89 | 89 |
|
90 | 90 |
|
91 | | --- !query 10 |
| 91 | +-- !query |
92 | 92 | select 12345678901234567890.0 * 12345678901234567890.0 |
93 | | --- !query 10 schema |
| 93 | +-- !query schema |
94 | 94 | struct<> |
95 | | --- !query 10 output |
| 95 | +-- !query output |
96 | 96 | java.lang.ArithmeticException |
97 | 97 | Decimal(expanded,152415787532388367501905199875019052100,39,0}) cannot be represented as Decimal(38, 2). |
98 | 98 |
|
99 | 99 |
|
100 | | --- !query 11 |
| 100 | +-- !query |
101 | 101 | select 1e35BD / 0.1 |
102 | | --- !query 11 schema |
| 102 | +-- !query schema |
103 | 103 | struct<> |
104 | | --- !query 11 output |
| 104 | +-- !query output |
105 | 105 | java.lang.ArithmeticException |
106 | 106 | Decimal(expanded,1000000000000000000000000000000000000,37,0}) cannot be represented as Decimal(38, 6). |
107 | 107 |
|
108 | 108 |
|
109 | | --- !query 12 |
| 109 | +-- !query |
110 | 110 | select 123456789123456789.1234567890 * 1.123456789123456789 |
111 | | --- !query 12 schema |
| 111 | +-- !query schema |
112 | 112 | struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> |
113 | | --- !query 12 output |
| 113 | +-- !query output |
114 | 114 | 138698367904130467.654320988515622621 |
115 | 115 |
|
116 | 116 |
|
117 | | --- !query 13 |
| 117 | +-- !query |
118 | 118 | select 123456789123456789.1234567890 * 1.123456789123456789 |
119 | | --- !query 13 schema |
| 119 | +-- !query schema |
120 | 120 | struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> |
121 | | --- !query 13 output |
| 121 | +-- !query output |
122 | 122 | 138698367904130467.654320988515622621 |
123 | 123 |
|
124 | 124 |
|
125 | | --- !query 14 |
| 125 | +-- !query |
126 | 126 | select 12345678912345.123456789123 / 0.000000012345678 |
127 | | --- !query 14 schema |
| 127 | +-- !query schema |
128 | 128 | struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,9)> |
129 | | --- !query 14 output |
| 129 | +-- !query output |
130 | 130 | 1000000073899961059796.725866332 |
131 | 131 |
|
132 | 132 |
|
133 | | --- !query 15 |
| 133 | +-- !query |
134 | 134 | drop table decimals_test |
135 | | --- !query 15 schema |
| 135 | +-- !query schema |
136 | 136 | struct<> |
137 | | --- !query 15 output |
| 137 | +-- !query output |
138 | 138 |
|
0 commit comments