Upsolver
Search…
Welcome to Upsolver
Getting Started
Start using Upsolver for free
Get started as a Upsolver user
Upsolver concepts
Upsolver Amazon AWS deployment guide
Tutorials and FAQ
Glossary
Language guide
SQL syntax reference
Functions
Aggregation Functions
APPROX_COUNT_DISTINCT
APPROX_COUNT_DISTINCT_EACH
AVG
AVG_EACH
AVG_TIME_SERIES
COLLECT_SET
COLLECT_SET_EACH
COUNT
COUNT(*)
COUNT_DISTINCT
COUNT_EACH
COUNT_IF
DECAYED_SUM
DYNAMIC_SESSIONS
FIRST
FIRST_ARRAY
FIRST_EACH
FIRST_TIME_SERIES
LAST
LAST_ARRAY
LAST_EACH
LAST_K
LAST_K_EACH
LAST_TIME_SERIES
MAX
MAX_BY
MAX_EACH
MAX_TIME_SERIES
MIN
MIN_BY
MIN_EACH
MIN_TIME_SERIES
SESSION_COUNT
STD_DEV
STD_DEV_EACH
STRING_MAX_EACH
STRING_MIN_EACH
SUM
SUM_EACH
SUM_TIME_SERIES
WEIGHTED_AVERAGE
Calculated functions
Data formats
Data types and features
Database output options
Permissions list
Index
Troubleshooting
Connecting data sources
Amazon AWS data sources
Microsoft Azure data sources
Kafka data source
Google Cloud Storage data source
File upload data source
CDC data sources (Debezium)
JDBC data source
HDFS data source
Data source UI
Data source properties
Data outputs and data transformation
Data outputs
Data transformation
Guide for developers
Upsolver REST API
CI/CD on Upsolver
Administration
Connections
Clusters
Python UDF
Reference data
Workspaces
Monitoring
Security
Release notes
Change log
Support
Upsolver support portal
Powered By
GitBook
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.
Syntax
LAST_ARRAY(VALUE)
Arguments
VALUE:
An expression of any type. ‌
Returns
The result is an array of the same type as
VALUE
.
Example
Data
1
[
2
{
3
"id"
:
1
,
4
"name"
:
"Jimmy"
,
5
"emails"
:
[
6
"
[email protected]
"
,
7
"
[email protected]
"
8
]
9
}{
10
"id"
:
2
,
11
"name"
:
"Peter"
,
12
"emails"
:
[
13
"
[email protected]
"
14
]
15
}{
16
"id"
:
1
,
17
"name"
:
"Jimmy"
,
18
"emails"
:
[
19
"
[email protected]
"
,
20
"
[email protected]
"
21
]
22
}{
23
"id"
:
3
,
24
"name"
:
"Link"
,
25
"emails"
:
[
26
27
]
28
}
29
]
Copied!
Query:
Display the latest contents of a field for each key:
1
SELECT
2
data
.
id
AS
id:
BIGINT
,
3
LAST_ARRAY
(
data
.
emails
[])
AS
last_array_data_emails:STRING
4
FROM
5
"FIRST_ARRAY_DATA"
6
GROUP
BY
7
data
.
id
Copied!
Results:
1
{
2
"id"
:
2
,
3
"last_array_data_emails"
:
[
4
"
[email protected]
"
5
]
6
}{
7
"id"
:
3
8
}{
9
"id"
:
1
,
10
"last_array_data_emails"
:
[
11
"
[email protected]
"
,
12
"
[email protected]
"
13
]
14
}
Copied!
Related Functions
​
LAST_K
FIRST_ARRAY
​
Dialog
Previous
LAST
Next
LAST_EACH
Last modified
8mo ago
Copy link
Contents
Syntax
Arguments
Returns
Example
Related Functions
Dialog