COLLECT_UNIQUE
This page describes the COLLECT_UNIQUE function in Lenses SQL.
COLLECT_UNIQUE(expr, maxN)
Returns an array of unique values in which each value in the input set is assigned to an element of the array.
Available in:
Processor (stateless)
Processors (stateful)
SQL Studio
Sample code:
USE `kafka`;
SELECT COLLECT_UNIQUE(total, 5)
FROM orders-events
Output:
{
"value": {
"COLLECT_UNIQUE": [
56.8,
25.75,
88.97,
19.47,
99.26
]
}
}