v.19.7New Features
Add a Second Version of the Function Groupuniqarray with an Optional Max_size Parameter That Limits the Size of the Resulting Array
Add a second version of the functiongroupUniqArraywith an optionalmax_sizeparameter that limits the size of the resulting array. This behavior is similar togroupArray(max_size)(x)function. #5026 (Guillaume Tassery)
Why it matters
This feature addresses the need to control the maximum size of the array returned bygroupUniqArray, similar to groupArray(max_size)(x). It helps users prevent excessively large arrays in query results, improving performance and memory usage.How to use it
Use the newgroupUniqArray function by optionally specifying the max_size parameter. For example:SELECT groupUniqArray(10)(column_name) FROM tableThis will return an array of unique values from
column_name limited to 10 elements.