Excerpt |
---|
|
Siddhi Inbuilt Aggregate Functions in wiki format |
...
Syntax | <long|double> sum(<int|long|double|float> arg) |
---|
Extension Type | Aggregate Function |
---|
Description | Calculates the sum for all the events. |
---|
Parameter | The value that needs to be summed. |
---|
Return Type | Returns long if the input parameter type is int or long , and returns double if the input parameter type is float or double. |
---|
Examples | sum(20 ) returns the sum of 20s as a long value for each event arrival and expiry. sum(temp) returns the sum of all temp attributes based on each event arrival and expiry.
|
---|
<long|double> sum(<int|long|double|float>
arg)
...
...
temp) returns the sum of all temp attributes based on each event arrival and expiry.
|
avg
Syntax | |
---|
Extension Type | |
---|
Description | |
---|
Parameter | |
---|
Return Type | |
---|
Examples |
---|
...
<double> avg(<int|long|double| |
...
float> arg) |
Extension Type |
---|
...
| Aggregate Function |
---|
Description |
---|
...
| Calculates the average for all the events. |
---|
Parameter |
---|
...
| arg : The value that need to be averaged. |
---|
Return Type |
---|
...
| Returns the calculated average value as a double. |
---|
Example |
---|
...
avg(temp) returns the average temp value for all the events based on their arrival and expiry. |
max
Syntax | |
---|
Extension Type | |
---|
Description | |
---|
Parameter | |
---|
Return Type | |
---|
Examples |
---|
<int|long|double| |
...
float> max(<int|long|double| |
...
float> arg) |
Extension Type |
---|
...
| Aggregate Function |
---|
Description |
---|
...
...
maximum value for all the events. |
Parameter |
---|
...
...
needs to be compared to find the |
...
maximum value. |
Return Type |
---|
...
...
the maximum value in the same data type as the input. |
...
Example | max(temp) returns the maximum temp value recorded for all the events based on their arrival and expiry. |
---|
min
...
Extension Type | |
---|
Description | |
---|
Parameter | |
---|
Return Type | |
---|
Examples |
---|
Syntax | <int|long|double| |
---|
...
float> min(<int|long|double| |
...
float> arg) |
Extension Type |
---|
...
| Aggregate Function |
---|
Description |
---|
...
...
minimum value for all the events. |
Parameter |
---|
...
...
needs to be compared to find the |
...
minimum value. |
Return Type |
---|
...
...
the minimum value in the same type as the input. |
Example |
---|
...
min(temp) returns the minimum temp value recorded for all the events based on their arrival and expiry. |
count
Syntax | |
---|
Extension Type | |
---|
Description | |
---|
Parameter | |
---|
Return Type | |
---|
Examples |
---|
<long> count() |
Extension Type |
---|
...
| Aggregate Function |
---|
Description |
---|
...
| Returns the count of all the events. |
---|
Return Type |
---|
...
| Returns the event count as a long. |
---|
Example |
---|
...
...
returns the count of all the events. |
stddev
Syntax | |
---|
Extension Type | |
---|
Description | |
---|
Parameter | |
---|
Return Type | |
---|
Examples |
---|
...
<double> stddev(<int|long|double| |
...
float> arg) |
Extension Type |
---|
...
| Aggregate Function |
---|
Description |
---|
...
| Returns the calculated standard deviation for all the events. |
---|
Parameter |
---|
...
| arg : The value that should be used |
---|
...
to calculate the standard deviation. |
Return Type |
---|
...
| Returns the calculated standard deviation value as a double. |
---|
Example |
---|
...
stddev(temp) returns the calculated standard deviation of temp |
...
for all the events based on their arrival and expiry. |
...
Excerpt |
---|
|
averageTodo add other aggregate functions |
...