liuxinwang commented on issue #27856:
URL: https://github.com/apache/doris/issues/27856#issuecomment-1878155418
升级到1.2.7.1 当使用sum(常量 * decimal类型) 计算结果不准确,下面是一个复现示例:
```sql
CREATE TABLE `decimal_test` (
`id` bigint(20) NOT NULL COMMENT '',
`amount` decimal(20, 2) NOT NULL COMMENT ''
)ENGINE=OLAP
UNIQUE KEY(`id`)
COMMENT ''
DISTRIBUTED BY HASH(`id`) BUCKETS 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2",
"enable_unique_key_merge_on_write" = "true",
"disable_auto_compaction" = "false"
);
insert into decimal_test(id, amount)values(1, 1.22),(2, 3.44),(3, 69.90),(4,
99.90),(5, 339.22),
(6, 518.80),(7, 49.90),(8, 69.90),(9, 149.70),(10, 57.87),(11, 139.70),(12,
12.97),(13, 63.85),(14, 79.62);
select sum(1 * amount), sum(amount) from decimal_test;
```
result
```
sum1,sum2
"1655.9900000000005","1655.990000000"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]