Skip to main content Skip to complementary content

LAST_EACH

Returns an array of the last values per group in the time window.

Note that this function is non-deterministic.

Syntax

LAST_EACH([MAX_VALUES,] GROUP, VALUE)

Arguments

MAX_VALUES

Type: integer

Default: 2,147,483,647

(Optional) Limits the number of key value elements in the output.

GROUP

Type: any

The field to group by.

VALUE

Type: any

The field to get the first value of.

Returns

Type: array

Returns array of key-value pairs where each GROUP is matched to the last VALUE seen for that group.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!