Apama 10.11.3 | Developing Apama Applications | Developing Apama Applications in EPL | Working with Streams and Stream Queries | Working with lots that contain multiple items | Behavior of stream queries with lots
 
Behavior of stream queries with lots
 
Size-based windows and lots
Join operations and lots
Grouped projections and lots
This topic provides advanced information about how queries process lots that they receive on their input streams. The information here requires a thorough understanding of streams, queries, and the information about lots presented so far.
To understand how stream queries behave when receiving lots that contain more than one item, consider the window content of the query before the lot is input and the window content of the query after the lot is input. The difference between these two states determines the output of the query. For example, consider the following queries:
// event A { float x; }
stream<A>     sA := from a in all A() retain 3 every 3 select a;
stream<float> sB := from a in sA select a.x;
stream<float> sC := from a in sA select sum(a.x);
The following diagram shows the lot output by each stream on each activation of the query.
Illustration of the lot output
As can be seen, in the queries that contain aggregate functions, the aggregate expressions (and projections) are evaluated, at most, once per query activation. All queries, with the exception of those containing a group by clause, behave in this way.