stoneatom / stonedb

StoneDB is an Open-Source MySQL HTAP and MySQL-Native DataBase for OLTP, Real-Time Analytics, a counterpart of MySQLHeatWave. (https://stonedb.io)
https://stonedb.io/
GNU General Public License v2.0
862 stars 139 forks source link

bug: large amount of data aggregation, result set incorrect #1473

Open davidshiz opened 1 year ago

davidshiz commented 1 year ago

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

Describe the problem

10G SSB, 59986052 rows of lineorder table, return incorrect result set

mysql> SELECT sum(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue FROM lineorder WHERE LO_ORDERDATE >= '19930101' and LO_ORDERDATE <= '19931231' AND LO_DISCOUNT BETWEEN 1 AND 3 AND LO_QUANTITY < 25;
+---------------+
| revenue       |
+---------------+
| 4473869183595 |
+---------------+
1 row in set (4.52 sec)

Expected behavior

mysql> SELECT sum(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue FROM lineorder WHERE LO_ORDERDATE >= '19930101' and LO_ORDERDATE <= '19931231' AND LO_DISCOUNT BETWEEN 1 AND 3 AND LO_QUANTITY < 25;
+---------------+
| revenue       |
+---------------+
| 4472807765583 |
+---------------+
1 row in set (1 min 3.38 sec)

How To Reproduce

No response

Environment

root@ub01:/stonedb57/install/bin# ./mysqld --version
./mysqld  Ver 5.7.36-StoneDB-v1.0.3 for Linux on x86_64 (build-)
build information as follow:
        Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
        Branch name: stonedb-5.7-dev
        Last commit ID: 05db04de4
        Last commit time: Date:   Wed Mar 22 21:09:55 2023 +0800
        Build time: Date: Thu Mar 23 14:37:50 CST 2023

Are you interested in submitting a PR to solve the problem?

davidshiz commented 1 year ago

1G SSB, 6001215 rows of lineorder table, The result set is correct

adofsauron commented 1 year ago

ACK

adofsauron commented 1 year ago

set global tianmu_groupby_parallel_degree=0;

wisehead commented 1 year ago

please find out the root cause of parallel group by and fix it. otherwise we can't use this feature.

adofsauron commented 1 year ago

ok