Developing Apama Applications > Developing Apama Applications in EPL > Working with Streams and Stream Queries > Working with lots that contain multiple items > Stream queries that generate lots
Stream queries that generate lots
To generate a lot that contains multiple items, a stream query must specify a simple projection or an aggregate projection that contains a group by clause. The stream query must also either receive lots that contain multiple items or must contain one of the following:
*A batched window
*A timed window with the rstream keyword (this must be a simple projection, and not an aggregate projection)
*A join of either type.
A query with a non-grouped aggregate projection never generates multiple items. It generates a single item or nothing.
A timed window with the rstream keyword can generate lots because multiple items can have the same timestamp. In a timed window, when items with the same timestamp expire they all leave the window at the same time. However, the correlator still maintains the order in which the items were generated or received.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.