[MCOL-564] Aggregation overflow error Created: 2017-02-10  Updated: 2019-06-24  Resolved: 2019-05-29

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 1.0.7, 1.1.5
Fix Version/s: 1.2.3

Type: Bug Priority: Major
Reporter: Daniel Lee (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: None

Issue Links:
Blocks
is blocked by MCOL-641 Full DECIMAL support in ColumnStore Closed
Duplicate
is duplicated by MCOL-1822 Change the default to use double when... Closed
Epic Link: ColumnStore Compatibility Improvements

 Description   

Build 1.0.7-1

This is a known issue.

MariaDB [mytest]> create table t1 (c1 bigint) engine=columnstore;
Query OK, 0 rows affected (0.34 sec)

MariaDB [mytest]> insert into t1 values (9223372036854775807), (9223372036854775807);
Query OK, 2 rows affected (0.18 sec)
Records: 2 Duplicates: 0 Warnings: 0

MariaDB [mytest]> select sum(c1) from t1;
ERROR 1815 (HY000): Internal error: An unexpected condition within the query caused an internal processing error within InfiniDB. Please check the log files for more details. Additional Information: aggregation data overflow.

in err.log

Feb 10 15:45:18 ip-172-30-0-236 joblist[18843]: 18.318893 |26|0|0| C 05 CAL0000: Aggregation overflow.: 9223283296451814817+152123350462331 > 9223372036854775807

I discuss with the InfiniDB engineers on this issue before. I believe the issue is that the datatype of the variable used to hold intermediate and final aggregation result is 64 bit. Summing two hugh 64 bit values would trigger this error. I believe this issue is system wide, rather than one specific area so we need to look at it from a system design point of view.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2017-02-10 ]

For MariaDB's SUM() function the result type is DECIMAL which can hold a 65 digit integer. We need to be able to support DECIMAL properly to get around that limit.

Comment by David Thompson (Inactive) [ 2018-08-07 ]

Note that in less extreme cases setting infinidb_double_for_decimal_math = on can also be a solution as you increase the possible range of intermediate accumulated values by using double however double precision can come into play.

Comment by Andrew Hutchings (Inactive) [ 2019-05-29 ]

Duplicate of MCOL-1822 which is fixed in 1.2.3

Generated at Thu Feb 08 02:22:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.