[MCOL-4585] group_concat followed by regr_avgx gives wrong results Created: 2021-03-05  Updated: 2021-03-08  Resolved: 2021-03-08

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 5.5.2
Fix Version/s: 5.5.2

Type: Task Priority: Blocker
Reporter: David Hall (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: regression

Sprint: 2021-4

 Description   

The following query gives bad results:
select l_orderkey, group_concat(l_partkey, "TF" order by l_partkey) partkeys, regr_avgx(l_tax, l_extendedprice) avg_price from lineitem where l_orderkey < 10 group by l_orderkey order by l_orderkey;
------------------------------------------------------------------------------------

l_orderkey partkeys avg_price

------------------------------------------------------------------------------------

1 2132TF,15635TF,24027TF,63700TF,67310TF,155190TF 30310.211667
2 106170TF 0.000000
3 4297TF,19036TF,29380TF,62143TF,128449TF,183095TF 0.000000
4 88035TF 0.000000
5 37531TF,108570TF,123927TF 49276.323333
6 139636TF 61998.310000
7 79251TF,94780TF,145243TF,151894TF,157238TF,163073TF,182052TF 37447.331429

------------------------------------------------------------------------------------
7 rows in set (0.154 sec)

There should be no 0.00000 in there



 Comments   
Comment by Daniel Lee (Inactive) [ 2021-03-08 ]

Build verified: 5.5.2-1 (Drone #1825)

Reproduced the issue in 5.5.1 and 5.5.2 Jenkins RC build.

New result:

MariaDB [tpch1]> select l_orderkey, group_concat(l_partkey, "TF" order by l_partkey) partkeys, regr_avgx(l_tax, l_extendedprice) avg_price from lineitem where l_orderkey < 10 group by l_orderkey order by l_orderkey;
+------------+--------------------------------------------------------------+--------------+
| l_orderkey | partkeys                                                     | avg_price    |
+------------+--------------------------------------------------------------+--------------+
|          1 | 2132TF,15635TF,24027TF,63700TF,67310TF,155190TF              | 30310.211667 |
|          2 | 106170TF                                                     | 44694.460000 |
|          3 | 4297TF,19036TF,29380TF,62143TF,128449TF,183095TF             | 34180.720000 |
|          4 | 88035TF                                                      | 30690.900000 |
|          5 | 37531TF,108570TF,123927TF                                    | 49276.323333 |
|          6 | 139636TF                                                     | 61998.310000 |
|          7 | 79251TF,94780TF,145243TF,151894TF,157238TF,163073TF,182052TF | 37447.331429 |
+------------+--------------------------------------------------------------+--------------+
7 rows in set (0.215 sec)

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