Apama 10.11.3 | Developing Apama Applications | Developing Apama Applications in EPL | Working with Streams and Stream Queries | Using dynamic expressions in stream queries | Understanding when the correlator evaluates particular expressions | Using dynamic expressions in projections
 
Using dynamic expressions in projections
In a simple projection, the correlator evaluates the select expression once for each item. The correlator evaluates the select expression as soon as a join operation produces an item, or if there is no join operation, as soon as an item enters a window.
In a simple projection, regardless of whether the select clause specifies the rstream keyword, the correlator evaluates expressions in the projection when the items would be present on the insert stream and the results are stored until needed for the remove stream.
In an aggregate projection, the correlator evaluates expressions in the projection when the items would be present on the insert stream.
If an aggregate projection contains a group by clause the correlator evaluates the group key once for each item. This happens as soon as a join operation produces an item, or if there is no join operation, as soon as an item enters a window.
The correlator evaluates aggregate and grouped expressions in two stages. The correlator evaluates arguments to aggregate functions once for each item as soon as it is produced by a join or if there is no join, as soon as it arrives in the window. The correlator evaluates the rest of the aggregate expression once for each lot.