Unique (window)
This window is used with a namespace such as unique:windowName
. The window retains and processes unique events based on the given parameters.
Function | Description |
---|---|
deduplicate (Stream Processor) | Duplicate events are removed based on the unique.key arriving in time.interval . |
ever (Window) | Retains latest events based on the unique keys . |
externalTimeBatch (Window) | Tumbling time window holds the latest events based on unique.key and various parameters for time. |
first (Window) | Retain first set of unique events based on unique.key . |
firstLengthBatch (Window) | Tumbling window holds window.length unique events based on unique.key |
firstTimeBatch (Window) | A batch-time or tumbling window that holds the unique events based on unique.key and sliding time period window.time with time offset defined by parameter start.time |
length (Window) | A sliding length window that holds the latest unique events base in unique.key . |
lengthBatch (Window) | This is a batch (tumbling) window that holds window.length number of latest unique events. |
time (Window) | This is a sliding time window that holds the latest unique events that arrived during window.time . |
timeBatch (Window) | This is a batch (tumbling) time window that is updated with the latest events based on unique.key tumbling time period window.time and time offset start.time . |
timeLengthBatch (Window) | The window tumbles upon the elapse of the time window window.time , or when a number of unique events have arrived i.e. window.length . |
Example
@App:name("unique")
@App:qlVersion("2")
CREATE STREAM DriverChangeStream (trainID STRING, driver STRING);
INSERT expired events INTO PreviousDriverChangeStream
SELECT trainID, driver
FROM DriverChangeStream WINDOW UNIQUE:EVER(trainID);