[MCOL-3946] Wrong number decimals in UNION of AVG Created: 2020-04-14 Updated: 2023-11-21 Resolved: 2023-10-25 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | 1.4.3 |
| Fix Version/s: | Icebox |
| Type: | Bug | Priority: | Minor |
| Reporter: | David Hall (Inactive) | Assignee: | Leonid Fedorov |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Description |
|
MariaDB [tpch1]> select 'Avg', avg(n_regionkey) from nation;
----
---- Notice there are four decimal places, which is correct. Now see
----
---- Which puts 4 decimal places for both. Presumably, the MAX (an INT) is promoted to long double. When used this way
-----
----- Which gives us the odd number of 9 decimals. See working_tpch1_compareLogOnly/qa/DL_union.sql.ref.log. |
| Comments |
| Comment by David Hall (Inactive) [ 2022-10-12 ] |
|
The problem probably stems from the fact that avg here is "promoted" to string, which loses the internal decimal count. |