COLLECT

This page describe the COLLECT function in Lenses SQL.

COLLECT(expr, maxN)

Returns an array 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(total, 5) 
FROM orders-events

Output:

{
  "value": {
    "COLLECT": [
      43.63,
      16.93,
      80.47,
      56.86,
      29.12
    ]
  }
}

Last updated

Was this helpful?