Skip to main content

TUMBLING_EXPRESSION()

A batch (tumbling) window that holds and process a number of events as specified in the expression.

Syntax

WINDOW TUMBLING_EXPRESSION(expression <STR>)
WINDOW TUMBLING_EXPRESSION(expression <STR>, current.event <BOOL>)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
expressionAn expression that defines what events the window should tumble. All possible valid expressions are allowed.STRNoNo
current.eventLet the window stream the current events out as and when they arrive to the window while expiring them in batches.falseBOOLYesNo

Example 1

CREATE STREAM cseEventStream (symbol string, price float, volume int);
CREATE WINDOW cseEventWindow (symbol string, price float, volume int) TUMBLING_EXPRESSION('count() < 5');
CREATE SINK STREAM OutputStream (symbol string, price double);

@info(name = 'query0')
INSERT INTO cseEventWindow
FROM cseEventStream;

@info(name = 'query1')
INSERT INTO OutputStream
SELECT symbol, sum(price) AS price
FROM cseEventWindow;

This collects and processes the events and only provides output after receiving five valid messages from cseEventStream.