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.keyand various parameters for time. | 
| FIRST | Retain first set of unique events based on unique.key. | 
| TUMBLING_FIRST | Tumbling window holds window.lengthunique events based onunique.key. | 
| TUMBLING_FIRST_TIME | A batch-time or tumbling window that holds the unique events based on unique.keyand sliding time periodwindow.timewith time offset defined by parameterstart.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.lengthnumber 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.keytumbling time periodwindow.timeand time offsetstart.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);