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 function groupUniqArray with an optional max_size parameter that limits the size of the resulting array. This behavior is similar to groupArray(max_size)(x) function. #5026 (Guillaume Tassery)
Introduces a second version of the groupUniqArray function that accepts an optional max_size parameter to limit the size of the resulting unique array.

Why it matters

This feature addresses the need to control the maximum size of the array returned by groupUniqArray, 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 new groupUniqArray function by optionally specifying the max_size parameter. For example:
SELECT groupUniqArray(10)(column_name) FROM table

This will return an array of unique values from column_name limited to 10 elements.