LAST_ARRAY
Returns the last array of values seen in events within the time window.
Unlike
LAST_K
this aggregation will not aggregate values across different events.LAST_ARRAY(VALUE)
VALUE:
An expression of any type. The result is an array of the same type as
VALUE
.[
{
"id":1,
"name":"Jimmy",
"emails":[
]
}{
"id":2,
"name":"Peter",
"emails":[
]
}{
"id":1,
"name":"Jimmy",
"emails":[
]
}{
"id":3,
"name":"Link",
"emails":[
]
}
]
Display the latest contents of a field for each key:
SELECT
data.id AS id:BIGINT,
LAST_ARRAY(data.emails[]) AS last_array_data_emails:STRING
FROM
"FIRST_ARRAY_DATA"
GROUP BY
data.id
{
"id":2,
"last_array_data_emails":[
]
}{
"id":3
}{
"id":1,
"last_array_data_emails":[
]
}

Last modified 1yr ago