Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,137 +2,137 @@
-- Number of queries: 16


-- !query 0
-- !query
create table decimals_test(id int, a decimal(38,18), b decimal(38,18)) using parquet
-- !query 0 schema
-- !query schema
struct<>
-- !query 0 output
-- !query output



-- !query 1
-- !query
insert into decimals_test values(1, 100.0, 999.0), (2, 12345.123, 12345.123),
(3, 0.1234567891011, 1234.1), (4, 123456789123456789.0, 1.123456789123456789)
-- !query 1 schema
-- !query schema
struct<>
-- !query 1 output
-- !query output



-- !query 2
-- !query
select id, a*10, b/10 from decimals_test order by id
-- !query 2 schema
-- !query schema
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)>
-- !query 2 output
-- !query output
1 1000.000000000000000 99.900000000000000000
2 123451.230000000000000 1234.512300000000000000
3 1.234567891011000 123.410000000000000000
4 1234567891234567890.000000000000000 0.112345678912345679


-- !query 3
-- !query
select 10.3 * 3.0
-- !query 3 schema
-- !query schema
struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)>
-- !query 3 output
-- !query output
30.90


-- !query 4
-- !query
select 10.3000 * 3.0
-- !query 4 schema
-- !query schema
struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)>
-- !query 4 output
-- !query output
30.90000


-- !query 5
-- !query
select 10.30000 * 30.0
-- !query 5 schema
-- !query schema
struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)>
-- !query 5 output
-- !query output
309.000000


-- !query 6
-- !query
select 10.300000000000000000 * 3.000000000000000000
-- !query 6 schema
-- !query schema
struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,34)>
-- !query 6 output
-- !query output
30.9000000000000000000000000000000000


-- !query 7
-- !query
select 10.300000000000000000 * 3.0000000000000000000
-- !query 7 schema
-- !query schema
struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,34)>
-- !query 7 output
-- !query output
30.9000000000000000000000000000000000


-- !query 8
-- !query
select (5e36BD + 0.1) + 5e36BD
-- !query 8 schema
-- !query schema
struct<>
-- !query 8 output
-- !query output
java.lang.ArithmeticException
Decimal(expanded,10000000000000000000000000000000000000.1,39,1}) cannot be represented as Decimal(38, 1).


-- !query 9
-- !query
select (-4e36BD - 0.1) - 7e36BD
-- !query 9 schema
-- !query schema
struct<>
-- !query 9 output
-- !query output
java.lang.ArithmeticException
Decimal(expanded,-11000000000000000000000000000000000000.1,39,1}) cannot be represented as Decimal(38, 1).


-- !query 10
-- !query
select 12345678901234567890.0 * 12345678901234567890.0
-- !query 10 schema
-- !query schema
struct<>
-- !query 10 output
-- !query output
java.lang.ArithmeticException
Decimal(expanded,152415787532388367501905199875019052100,39,0}) cannot be represented as Decimal(38, 2).


-- !query 11
-- !query
select 1e35BD / 0.1
-- !query 11 schema
-- !query schema
struct<>
-- !query 11 output
-- !query output
java.lang.ArithmeticException
Decimal(expanded,1000000000000000000000000000000000000,37,0}) cannot be represented as Decimal(38, 6).


-- !query 12
-- !query
select 123456789123456789.1234567890 * 1.123456789123456789
-- !query 12 schema
-- !query schema
struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)>
-- !query 12 output
-- !query output
138698367904130467.654320988515622621


-- !query 13
-- !query
select 123456789123456789.1234567890 * 1.123456789123456789
-- !query 13 schema
-- !query schema
struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)>
-- !query 13 output
-- !query output
138698367904130467.654320988515622621


-- !query 14
-- !query
select 12345678912345.123456789123 / 0.000000012345678
-- !query 14 schema
-- !query schema
struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,9)>
-- !query 14 output
-- !query output
1000000073899961059796.725866332


-- !query 15
-- !query
drop table decimals_test
-- !query 15 schema
-- !query schema
struct<>
-- !query 15 output
-- !query output

Loading