Grouper
Grouper
The Grouper is a sequencer block, that receives input events and aggregates (reorders) them by some key argument field (or multiple fields) value.
The Group block is useful to reorder the randomly ordered events based on some value in the events. The block collects these events and creates groups of events for every key value. The block will emit the collected events to the output group-by-group when either Flush event is received or the group size has reached the MaxCount attribute value.
Events
Name | Input/Output | Description |
---|---|---|
Data | Input | Incoming events with data arguments to be collected and sent out grouped (by GroupBy argument(s)) |
Flush | Input | Will cause all collected events to be sent out (grouped by GroupBy argument(s)) |
GroupedData | Output | Grouped (by GroupBy argument) events |
GroupDone | Output | Will be sent out after all GroupedData events for one group (by GroupBy argument(s)) has been sent out |
Flushed | Output | Will be emitted after Flush done |
Arguments
Name | Description |
---|---|
Any user-configurable input argument (or multiple arguments) | Argument(s), whose value will be used to group the incoming events. Note, that the argument(s) has(have) also to be selected as the key using the GroupBy attribute. Note also, that the argument(s) must be selected as data for Data and GroupedData events. This is done by clicking into the event's Data property and by selecting the argument name. |
Properties
Name | Description |
---|---|
GroupBy | Sets the argument (or multiple arguments) name in Data to group the output by |
MaxCount | When not zero, sets the maximum number of data to aggregate before sending it to GroupedData |
Example
For example, let's assume we have configured a Grouper block with Signal and Value arguments and set the GroupBy attribute to Signal.
The following table shows some example events that were sent to the block and also the corresponding output events that were emitted by the block in response:
Timestamp (in increasing order) | Input event (with argument values) | Output event (with argument values) |
---|---|---|
`T_1` | Data (Signal=Sig1,Value=1.23) | |
`T_2` | Data (Signal=Sig2,Value=12.34) | |
`T_3` | Data (Signal=Sig1,Value=1.38) | |
`T_4` | Data (Signal=Sig2,Value=12.12) | |
`T_5` | Data (Signal=Sig1,Value=1.13) | |
`T_6` | Flush | GroupedData (Signal=Sig1,Value=1.23) |
GroupedData (Signal=Sig1,Value=1.38) | ||
GroupedData (Signal=Sig1,Value=1.13) | ||
GroupDone | ||
GroupedData (Signal=Sig2,Value=12.34) | ||
GroupedData (Signal=Sig2,Value=12.12) | ||
GroupDone | ||
Flushed |
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.