-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3391 from 4ertus2/decimal
fix for Decimal128 group by [issue-3378]
- Loading branch information
Showing
6 changed files
with
64 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
dbms/tests/queries/0_stateless/00737_decimal_group_by.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
1.10 | ||
2.1000 | ||
3.100000000000 | ||
1.20 | ||
2.2000 | ||
3.200000000000 | ||
1.30 | ||
2.3000 | ||
3.300000000000 | ||
1 1.000000000000000000 10.000000000000000000 | ||
1 1.000000000000000000 10.000000000000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
select toDecimal32(1.1, 2) as x group by x; | ||
select toDecimal64(2.1, 4) as x group by x; | ||
select toDecimal128(3.1, 12) as x group by x; | ||
|
||
select materialize(toDecimal32(1.2, 2)) as x group by x; | ||
select materialize(toDecimal64(2.2, 4)) as x group by x; | ||
select materialize(toDecimal128(3.2, 12)) as x group by x; | ||
|
||
select x from (select toDecimal32(1.3, 2) x) group by x; | ||
select x from (select toDecimal64(2.3, 4) x) group by x; | ||
select x from (select toDecimal128(3.3, 12) x) group by x; | ||
|
||
DROP TABLE IF EXISTS test.decimal; | ||
CREATE TABLE IF NOT EXISTS test.decimal | ||
( | ||
A UInt64, | ||
B Decimal128(18), | ||
C Decimal128(18) | ||
) Engine = Memory; | ||
|
||
INSERT INTO test.decimal VALUES (1,1,1), (1,1,2), (1,1,3), (1,1,4); | ||
|
||
SELECT A, toString(B) AS B_str, toString(SUM(C)) AS c_str FROM test.decimal GROUP BY A, B_str; | ||
SELECT A, B_str, toString(cc) FROM (SELECT A, toString(B) AS B_str, SUM(C) AS cc FROM test.decimal GROUP BY A, B_str); | ||
|
||
DROP TABLE test.decimal; |