Windows

A window is a stateful element that can be named or unnamed, and retains rows based on a defined retention policy.

Since a window is a stateful element, with an underlying store, it can perform any operation specified by the opcode of an incoming event record. Depending on what changes are made to the contents of the store by the incoming event and its opcode, a window can produce output event records with different opcodes.

For example, if the window is performing aggregation logic, an incoming event record with an insert opcode can update the contents of the store and thus output an event record with an update opcode. The same could happen in a window implementing a left join.

A window can produce an output event record with same opcode as the input event record. If, for example, a window implemented a simple copy or a filter without any additional clauses, the input and output event records would have the same opcode.

An incoming event record with an insert opcode can produce an output event record with a delete opcode. For example, a window with a count-based retention policy (say keep 5 records) will delete those records from the store when the sixth event arrives, thus producing an output event record with a delete opcode.