matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.77k stars 275 forks source link

[Bug]: Incorrect result in calculating standard deviation. #14475

Open Ariznawlll opened 8 months ago

Ariznawlll commented 8 months ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

5078085cd5049fa721752637eb402902e48b2656

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

job url: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/7709943518/job/21012208316

image

Expected Behavior

image

Steps to Reproduce

table schema:

CREATE TABLE `table_basic_for_load_100M` (
  `col1` tinyint(4) NULL,
  `col2` smallint(6) NULL,
  `col3` int(11) NULL,
  `col4` bigint(20) NULL,
  `col5` smallint(6) NULL,
  `col6` int(11) NULL,
  `col7` bigint(20) NULL,
  `col8` largeint(40) NULL,
  `col9` float NULL,
  `col10` double NULL,
  `col11` varchar(255) NULL,
  `col12` date NULL,
  `col13` datetime NULL,
  `col14` datetime NULL,
  `col15` boolean NULL,
  `col16` DECIMAL(16, 6) NULL,
  `col17` text NULL,
  `col18` json NULL,
  `col19` text NULL,
  `col20` text NULL,
  `col21` text NULL,
  `col22` text NULL,
  `col23` text NULL,
  `col24` text NULL,
  `col25` text NULL
);

Additional information

No response

Ariznawlll commented 8 months ago

decimal的精度问题麻烦同时看下原因: ddl: select sum(abs(col16)) from big_data_test.table_basic_for_load_1B; select sum(ln(col16)) from big_data_test.table_basic_for_load_1B where col16 > 0;

image
Ariznawlll commented 8 months ago

table schema: create table if not exists big_data_test.table_basic_for_load_100M( col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 tinyint unsigned, col6 smallint unsigned, col7 int unsigned, col8 bigint unsigned, col9 float, col10 double, col11 varchar(255), col12 Date, col13 DateTime, col14 timestamp, col15 bool, col16 decimal(16,6), col17 text, col18 json, col19 blob, col20 binary(255), col21 varbinary(255), col22 vecf32(3), col23 vecf32(3), col24 vecf64(3), col25 vecf64(3) );

doris结果:

image

mo结果:

image

ddl: select sum(abs(col9)) from big_data_test.table_basic_for_load_100M; select sum(abs(col10)) from big_data_test.table_basic_for_load_100M; select sum(abs(col16)) from big_data_test.table_basic_for_load_100M;

zengyan1 commented 8 months ago

无进展

Ariznawlll commented 7 months ago

testing

Ariznawlll commented 7 months ago

testing

Ariznawlll commented 5 months ago

commit:6b1a10d62ec53a54394120d8c6327c7886c1ce15

image image

以上均为精度问题