[MCOL-4603] Replace long double with wide/narrow-decimal for avg() and sum() result type for all numerical datatypesdecimal result Created: 2021-03-12  Updated: 2021-07-12  Resolved: 2021-07-12

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr, PrimProc
Affects Version/s: 6.1.1
Fix Version/s: 6.1.1

Type: New Feature Priority: Major
Reporter: Roman Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MCOL-4667 Precision loss on AVG(decimal) Open
is duplicated by MCOL-4492 Aggregated DOUBLES (AVG and SUM) do n... Closed
PartOf
includes MCOL-4548 Regression: expression in HAVING cla... Closed
is part of MCOL-641 Full DECIMAL support in ColumnStore Closed
Sprint: 2021-5, 2021-6, 2021-8, 2021-9

 Description   

As of now MCS uses long double as an internal data for results of avg() and sum() for numerical data types columns except wide-decimal.
This approach imposes a number of limitations, e.g. we can not safely join on the aggregates results being a float number. Presumably long double math operations are slower comparing to int128.
This gets us to the point of replacing long double with wide-decimal as a result of avg() and sum() for all integer data types. This causes a wide consequences that covers lots of facilities of the code. The full list can be obtained by search for LONGDOUBLE in the repo.



 Comments   
Comment by Roman [ 2021-07-08 ]

4QA This feature replaces long double as the internal data type for sum() and avg() on all integer and decimal types. The expected outcome is that nothing had been broken. It would be nice if you measure the performance impact.

Comment by Gagan Goel (Inactive) [ 2021-07-09 ]

This patch broke the following tests:
in test001: working_tpch1_compareLogOnly/misc/sumavgoverflow.sql
in MTR: columnstore/future.mcol641-aggregate

If they can't be fixed soon enough, we should back out the change from 6.1.1.

Comment by Roman [ 2021-07-10 ]

The previous comment is irrelevant now.

Comment by Daniel Lee (Inactive) [ 2021-07-12 ]

Build verified: 6.1.1 ( #2769)

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