Skip to main content

TUMBLING_FIRST_TIME

A batch-time or tumbling window that holds the unique events according to the unique key parameters that have arrived within the time period of that window and gets updated for each such time window. When a new event arrives with a key which is already in the window, that event is not processed by the window.

Syntax

    WINDOW UNIQUE:TUMBLING_FIRST_TIME(<INT|LONG|FLOAT|BOOL|DOUBLE|STRING> unique.key, <INT|LONG> window.time)
WINDOW UNIQUE:TUMBLING_FIRST_TIME(<INT|LONG|FLOAT|BOOL|DOUBLE|STRING> unique.key, <INT|LONG> window.time, <INT|LONG> start.time)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
unique.keyThe attribute that should be checked for uniqueness.INT LONG FLOAT BOOL DOUBLE STRINGNoYes
window.timeThe sliding time period for which the window should hold events.INT LONGNoNo
start.timeSpecifies an offset in milliseconds in order to start the window at a time different to the standard time.Timestamp of the first event.INT LONGYesNo

Example 1

    CREATE STREAM CseEventStream (symbol string, price float, volume int)

INSERT all events INTO OutputStream
SELECT symbol, price, volume
FROM CseEventStream WINDOW UNIQUE:TUMBLING_FIRST_TIME(symbol,1 sec);

This holds the first unique events that arrive from the cseEventStream input stream during each second, based on the symbol,as a batch, and returns all the events to the OutputStream.