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
SUM
The sum of the values in the time window.
Syntax
SUM(VALUE)
Arguments
VALUE:
An expression that evaluates to a numeric.
Returns
The sum of the values in the file.
Notes
Sums are rounded down to the closest integer.
Example
Data
1
[
2
{
3
"serverIp"
:
"10.0.0.1"
,
4
"time"
:
1628894700000
,
5
"cpuUsage"
:
52.3
6
},
7
{
8
"serverIp"
:
"10.0.0.1"
,
9
"time"
:
1628894760000
,
10
"cpuUsage"
:
2.4
11
},
12
{
13
"serverIp"
:
"10.0.0.1"
,
14
"time"
:
1628894820000
,
15
"cpuUsage"
:
99.3
16
},
17
{
18
"serverIp"
:
"10.0.0.1"
,
19
"time"
:
1628894880000
,
20
"cpuUsage"
:
99.6
21
},
22
{
23
"serverIp"
:
"10.0.0.1"
,
24
"time"
:
1628894940000
,
25
"cpuUsage"
:
12.3
26
},
27
{
28
"serverIp"
:
"10.0.0.1"
,
29
"time"
:
1628895000000
,
30
"cpuUsage"
:
55
31
},
32
{
33
"serverIp"
:
"10.0.0.2"
,
34
"time"
:
1628894700000
,
35
"cpuUsage"
:
2.3
36
},
37
{
38
"serverIp"
:
"10.0.0.2"
,
39
"time"
:
1628894760000
40
},
41
{
42
"serverIp"
:
"10.0.0.2"
,
43
"time"
:
1628894820000
,
44
"cpuUsage"
:
9.3
45
},
46
{
47
"serverIp"
:
"10.0.0.2"
,
48
"time"
:
1628894880000
,
49
"cpuUsage"
:
9.6
50
},
51
{
52
"serverIp"
:
"10.0.0.2"
,
53
"time"
:
1628894940000
,
54
"cpuUsage"
:
2.3
55
}
56
]
Copied!
Query
Find out how much each cpu was used:
1
SELECT
2
SUM
(
data
.
cpuUsage
)
AS
sum_data_cpuusage:
BIGINT
,
3
data
.
serverIp
AS
serverip:STRING
4
FROM
5
"TIME_SERIES_DATA_w_NULL"
6
GROUP
BY
7
data
.
serverIp
Copied!
Results:
1
{
2
"sum_data_cpuusage"
:
23
,
3
"serverip"
:
"10.0.0.2"
4
}{
5
"sum_data_cpuusage"
:
320
,
6
"serverip"
:
"10.0.0.1"
7
}
Copied!
Related Functions
​
AVG
SUM_EACH
​
Dialog
Previous
STRING_MIN_EACH
Next
SUM_EACH
Last modified
8mo ago
Copy link
Contents
Syntax
Arguments
Returns
Notes
Example
Related Functions
Dialog