Skip to main content

TUMBLING_FIRST

This is a batch (tumbling) window that holds a specific number of unique events (depending on which events arrive first). The unique events are selected based on a specific parameter that is considered as the unique key. When a new event arrives with a value for the unique key parameter that matches the same of an existing event in the window, that event is not processed by the window.

Syntax

    WINDOW UNIQUE:TUMBLING_FIRST(<INT|LONG|FLOAT|BOOL|DOUBLE|STRING> unique.key, <INT> window.length)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
unique.keyThe attribute that should be checked for uniqueness.INT LONG FLOAT BOOL DOUBLE STRINGNoYes
window.lengthThe number of events the window should tumble.INTNoNo

Example 1

    CREATE WINDOW CseEventWindow (symbol string, price float, volume int);

INSERT all events INTO OutputStream
SELECT symbol, price, volume
FROM CseEventStream WINDOW UNIQUE:TUMBLING_FIRST(symbol, 10);

The window in this configuration holds the first unique events from the CseEventStream stream every second, and outputs them all into the the OutputStream stream. All the events in a window during a given second should have a unique value for the symbol attribute.