Adding window definitions to from and join clauses
The items flowing through a stream are ordered. In any given activation, there are zero or more items that are current. By default, the stream query operates on those current items.
Alternatively, a window may be defined. Window definitions specify which items the query should operate on in each activation, based on (but not limited to) the following:
The items within a given time period
A maximum number of items
The content of the items
As the window contents change, the items in the query projection will also change: new items will be inserted and old ones removed. The output from a query is a stream of items.
If the projection is an aggregate projection then the query output is the result of evaluation of the
select clause when the window contents change. See
Aggregating items in projections.
If the projection is a simple, non-aggregate projection, the default output is the insertion stream or istream for short, of new projected items. Alternatively, if the restream keyword is specified in the select clause, the output is the remove stream (or rstream) of items that have become obsolete.