Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
groupArrayResample
Description
TheResample
combinator can be applied to the groupArray aggregate function to
divide the range of a specified key column into a fixed number of intervals (N)
and construct the resulting array by selecting one representative value
(corresponding to the minimum key) from the data points falling into each interval.
It creates a downsampled view of the data rather than collecting all values.
Example usage
Let’s look at an example. We’ll create a table which contains thename, age and
wage of employees, and we’ll insert some data into it:
[30,60)
and [60,75). Since we use integer representation for age, we get ages in the
[30, 59] and [60,74] intervals.
To aggregate names in an array, we use the groupArray aggregate function.
It takes one argument. In our case, it’s the name column. The groupArrayResample
function should use the age column to aggregate names by age. To define the
required intervals, we pass 30, 75, 30 as arguments into the groupArrayResample
function: