...
group_by:
An optional list of attributes over which the grouping should occur.aggregations:
A list of aggregate functions (see below).SUPPRESS_FULL_META_DATA_HANDLING:
Boolean flag set to true if the handling of meta data other than Time Interval (e.g. Latency) should be supressed.
The following optional boolean parameters control when a new aggregation value is transferred (see below for useful examples):
eval_at_new_element
: Outputs an updated aggregation value when a new element gets valid. In the case that more than one element gets valid at the same time (same start timestamp), this operator outputs for each element an output value in the order of arrival. The default value istrue
.eval_at_outdating
: Outputs an updated aggregation value when one ore more elements gets invalid with the value after the removal of the invalid elements. The default value istrue
.eval_before_remove_outdating
: Outputs an updated aggregation value before removing the invalid elements instead of after removal. The default value isfalse
.eval_at_done
: Outputs the value at the time the operator gets the done signal. The default value isfalse
.output_only_changes
: Suppresses elements that are equal to the previous outputted element. The default value isfalse
. If you want to use this, make sure the equals-method for every attribute type is implemented.
Aggregation Functions
Function Name | Description | Parameters | Examples | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Count | Outputs the number of steam elements. |
| ['FUNCTION' = 'Count'] ['FUNCTION' = 'Count', 'OUTPUT_ATTRIBUTES' = 'number_of_elements'] | ||||||||||||
DistinctCount | Output the numbers of different stream elements | ||||||||||||||
Sum | Outputs the sum of elements. |
| ['FUNCTION' = 'Sum'] ['FUNCTION' = 'Sum', 'INPUT_ATTRIBUTES' = 'value1'] ['FUNCTION' = 'Sum', 'INPUT_ATTRIBUTES' = ['value1', 'value2']] | ||||||||||||
Avg | Average value (mean) | TODO (similar to Sum) | |||||||||||||
Min | Min value | TODO (similar to Sum) | |||||||||||||
Max | Max value | TODO (similar to Sum) | |||||||||||||
First | The first element of a window. See example below. |
| You should use the following settings: output_only_changes = true This results in getting the first element in each window. Especially useful with a tumbling window. | ||||||||||||
Last | The last element of a window. See example below. |
| You should use the following settings: EVAL_AT_NEW_ELEMENT = false This results in getting the last element in each window. Especially useful with a tumbling window. | ||||||||||||
Trigger | The tuple that triggers the output. | TODO | |||||||||||||
Variance | Calculates the variance | TODO (similar to Sum) | |||||||||||||
StdDev | Standard deviation | ||||||||||||||
TopK | Calculates the top-K list | TODO | |||||||||||||
Nest | Nests the valid elements as list. If given more than one attribute, this will contain the tuple projected on the attributes | INPUT_ATTRIBUTES, required |
| ||||||||||||
DistincNest | Same as nest, but removes duplicates | ||||||||||||||
A number of Univariate Statistics: GeometricMean Kurtosis Skewness IQR (InterQuantileRange) MCQ (MeanCrossingRate) RMS (RootMeanSquare) FrEnergy (SpectralEnergy) FrDmEntropy FrPeakFreq FrMag5 MSE (Mean Square Error) RMSE (Root Mean Square Error) | See e.g. https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/stat/descriptive/UnivariateStatistic.html | [ 'FUNCTION' = 'RMSE', 'INPUT_ATTRIBUTES' = 'error' ] [ 'FUNCTION' = 'MSE', 'INPUT_ATTRIBUTES' = 'error' ] |
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
counted = AGGREGATION({AGGREGATIONS = [['FUNCTION' = 'Count']], GROUP_BY = ['publisher', 'item']}, windowed) |
...