...
Function Name | Description | Parameters | Examples | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Count | Outputs the number of steam elements. |
| ['FUNCTION' = 'Count'] ['FUNCTION' = 'Count', 'OUTPUT_ATTRIBUTES' = 'number_of_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) | |||||||||||||
TopK | Calculates the top-K list | TODO | |||||||||||||
Nest | Nests the valid elements as list. | TODO |
...
Code Block | ||
---|---|---|
| ||
/// Tumnbling window
tumbling = TIMEWINDOW({
size = [5, 'MINUTES'],
advance = [5, 'MINUTES']
},
selectCenter
)
/// Select last of tumbling
reduce = AGGREGATION({
aggregations = [['FUNCTION' = 'Last']],
EVAL_AT_NEW_ELEMENT = false,
EVAL_BEFORE_REMOVE_OUTDATING = true,
group_by = ['movingObjectId']
},
tumbling
)
/// Remove the grouping id (because it will be in the unnested tuple)
withoutId = PROJECT({
attributes = ['last']
},
reduce
)
/// Unnest the tuple
output = UNNEST({
attribute='last'
},
withoutId
) |
...