Skip to main content

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

FunctionDescription
EVERRetains latest events based on the unique keys.
TUMBLING_EXTERNAL_TIMETumbling time window holds the latest events based on unique.key and various parameters for time.
FIRSTRetain first set of unique events based on unique.key.
TUMBLING_FIRSTTumbling window holds window.length unique events based on unique.key.
TUMBLING_FIRST_TIMEA 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_LENGTHA sliding length window that holds the latest unique events base in unique.key.
TUMBLING_LENGTHThis is a batch (tumbling) window that holds window.length number of latest unique events.
SLIDING_TIMEThis is a sliding time window that holds the latest unique events that arrived during window.time.
TUMBLING_TIMEThis 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_LENGTHThe 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);