groupUniqArray
Creates an array from different argument values.
Creates an array from different argument values.
The memory consumption of this function is the same as for the uniqExact function.
Syntax
groupUniqArray(x)
groupUniqArray(max_size)(x)Parameters
max_size— Limits the size of the resulting array tomax_sizeelements.groupUniqArray(1)(x)is equivalent to[any(x)].UInt64
Arguments
x— Expression.Any
Returned value
Returns an array of unique values. Array
Examples
Usage example
CREATE TABLE t (x UInt8) ENGINE = Memory;
INSERT INTO t VALUES (1), (2), (1), (3), (2), (4);
SELECT groupUniqArray(x) FROM t;┌─groupUniqArray(x)─┐
│ [1,2,3,4] │
└───────────────────┘With max_size parameter
SELECT groupUniqArray(2)(x) FROM t;┌─groupUniqArray(2)(x)─┐
│ [1,2] │
└──────────────────────┘Introduced in version 1.1.
groupConcat
Calculates a concatenated string from a group of strings, optionally separated by a delimiter, and optionally limited by a maximum number of elements.
intervalLengthSum
Takes multiple numeric ranges and calculates the total length when all overlapping parts are combined into a single unified range.