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.0.
groupNumericIndexedVector
Aggregates (index, value) pairs into a numeric indexed vector (a sparse vector addressed by an integer index) and supports pointwise operations between such vectors.
histogram
Calculates an adaptive histogram with up to the specified number of bins over the input values, returning an array of (lower, upper, height) tuples.