WINDOW UNIQUE
This window is used with a namespace such as WINDOW UNIQUE:WINDOW_NAME
. The window retains and processes unique events based on the given parameters.
Unique Windows
Function | Description |
---|---|
EVER | Retains latest events based on the unique keys . |
TUMBLING_EXTERNAL_TIME | Tumbling time window holds the latest events based on unique.key and various parameters for time. |
FIRST | Retain first set of unique events based on unique.key . |
TUMBLING_FIRST | Tumbling window holds window.length unique events based on unique.key . |
TUMBLING_FIRST_TIME | 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 . |
SLIDING_LENGTH | A sliding length window that holds the latest unique events base in unique.key . |
TUMBLING_LENGTH | This is a batch (tumbling) window that holds window.length number of latest unique events. |
SLIDING_TIME | This is a sliding time window that holds the latest unique events that arrived during window.time . |
TUMBLING_TIME | 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 . |
TUMBLING_TIME_LENGTH | 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 1
CREATE STREAM DriverChangeStream (trainID STRING, driver STRING);
INSERT expired events INTO PreviousDriverChangeStream
SELECT trainID, driver
FROM DriverChangeStream WINDOW UNIQUE:EVER(trainID);