[MCOL-890] group_contact returns garbage Created: 2017-08-24 Updated: 2020-08-25 Resolved: 2017-09-01 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | 1.0.10 |
| Fix Version/s: | 1.0.12, 1.1.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Description |
|
The following returns garbage: // Default CHARSET=latin1 has same behavior insert into phased_info values ('HO840F124135526679', 1, '1'); select group_concat(animalid),count(animalid) as ct from phased_info group by sha1sum;
-----------------------
----------------------- However:
-----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------- and
-----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------- So casting the column before group_concat, OR not using the same column in another aggregate, seems to fix it. |
| Comments |
| Comment by David Hall (Inactive) [ 2017-08-25 ] |
|
GROUP_CONCAT is not like any other aggregate function. It may have its own internal ORDER BY clause. In the columnstore code, GROUP_CONCAT is handled via very specific code just for it. Columnstore only retrieves any given row once, regardless of the number of functions that use it. In joblistfactory, around line 975, there's optimization logic to turn off dictionary lookup for count fields, the thought being that the time required is a waste as count doesn't care about the contents. There's also logic to turn the lookup on if any other function, field or where clause uses the column. Unfortunately, since GROUP_CONCAT is handled differently, the generic logic never turns the dictionary lookup back on for the fields involved. This results in the string tokens, rather than the strings, being concatenated, |
| Comment by David Hall (Inactive) [ 2017-08-29 ] |
|
Git pull requests 245 and 246 |
| Comment by Daniel Lee (Inactive) [ 2017-09-01 ] |
|
Build verified: 1.1.0 GitHub source /root/columnstore/mariadb-columnstore-server /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine |
| Comment by Daniel Lee (Inactive) [ 2017-09-01 ] |
|
Build verified: 1.0.12 source /root/columnstore/mariadb-columnstore-server /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine |