Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt
hiddentrue

Siddhi Inbuilt Aggregate Functions in wiki format

...

Syntax<int|long|double|float> max(<int|long|double|float> arg)
Extension TypeAggregate Function
DescriptionReturns the maximum value for all the events.
Parameterarg: The value that needs to be compared to find the maximum value.
Return TypeReturns the maximum value in the same data type as the input.
Examplemax(temp) returns the maximum temp value recorded for all the events based on their arrival and expiry.

Minimum
Anchor
min
min
 

Syntax<int|long|double|float> min(<int|long|double|float> arg)
Extension TypeAggregate Function
DescriptionReturns the minimum value for all the events.
Parameterarg: The value that needs to be compared to find the minimum value.
Return TypeReturns the minimum value in the same type as the input.
Examplemin(temp) returns the minimum temp value recorded for all the events based on their arrival and expiry.

...

Syntax<double> stddev(<int|long|double|float> arg)
Extension TypeAggregate Function
DescriptionReturns the calculated standard deviation for all the events.
Parameterarg: The value that should be used to calculate the standard deviation.
Return TypeReturns the calculated standard deviation value as a double.
Examplestddev(temp) returns the calculated standard deviation of temp for all the events based on their arrival and expiry.

Distinct Count 
Anchor
Distinct Count
Distinct Count

Syntax<long> distinctcount(<int|long|double|float|string> arg)
Extension TypeAggregate Function
DescriptionAggregate function to returns Returns the count of distinct occurances of occurrences for a given arg
Parameterarg: The value that should be counted
Return TypeReturns the count of distinct occurances of for given arg
Example

distinctcount(pageID) for following output will return returns 3.

 "WEB_PAGE_1"
 "WEB_PAGE_1"
 "WEB_PAGE_2"
 "WEB_PAGE_3"
 "WEB_PAGE_1"
 "WEB_PAGE_2"

Forever Maximum 
Anchor
Forever Maximum
Forever Maximum

Syntax<int|long|double|float> maxForever (<int|long|double|float> arg)
Extension TypeAggregate Function
DescriptionAttribute This is the attribute aggregator to store the maximum value for a given attribute throughout the lifetime of the query regardless of any windows in-front.
Parameterarg: The value that needs to be compared to find the maximum value.
Return TypeReturns the maximum value in the same data type as the input.
ExamplemaxForever(temp) returns the maximum temp value recorded for all the events throughout the lifetime of query

Forever Minimum 
Anchor
Forever Minimum
Forever Minimum

Syntax<int|long|double|float> minForever (<int|long|double|float> arg)
Extension TypeAggregate Function
DescriptionAttribute This is the attribute aggregator to store the minimum value for a given attribute throughout the lifetime of the query regardless of any windows in-front.
Parameterarg: The value that needs to be compared to find the minimum value.
Return TypeReturns the minimum value in the same data type as the input.
ExampleminForever(temp) returns the minimum temp value recorded for all the events throughout the lifetime of query

...