array_agg_distinct

Description

Returns an array of distinct input values. The expression must be a valid expression (not a regex or other type). Different from array_agg, array_agg_distinct does not accept an order_by argument, and the order of values in the output array is non-deterministic.

Return type

array

Domain

This is an aggregate function (aggregates rows over a group in aggregate verbs.)

Categories

Usage

array_agg_distinct(expr)

Argument

Type

Optional

Repeatable

Restrictions

expr

variant

no

no

none

Examples

statsby server_type:array_agg_distinct(server_type), group_by(region)

Sets server_type to an array containing all distinct server types for each region. The order of the server types in each region is non-deterministic.