Bundles

In some cases, a particular event can cause multiple output rows, and those rows can be grouped into a bundle. A bundle is a set of two or more data messages that are conceptually part of the same operation and are thus grouped together.

Your output adapter may see and process bundles differently from individual messages.

Bundles apply only to adapters, and not to UDFs.

There are two situations in which bundles may occur:

Bundling is not the same as aggregating. An aggregate function, such as AVG() or SUM(), produces a single output from multiple input rows. For example, if you have 100 stock transactions and thencalculate the average price, you will onlyonly receive oneoutput (the average price). If you perform an operation that creates a bundle, that bundle can have multiple rows instead of just one, even though the entire bundle was created based on a single event or arriving row. Each of the rows in a bundle is a discrete row, and any query downstream will see (and process) each of those rows.

Although all messages in a bundle have the same row timestamp, not all messages with the same row timestamp are necessarily in the same bundle.

A bundle may contain any type of message (for example, negative tuples as well as positive tuples) EXCEPT other bundles. In other words, there is no such thing as a nested bundle.

In some situations, your output adapter may need to recognize that messages have arrived as a bundle and may need to extract individual messages and possibly process the bundled messages in a special way.

The details of extracting messages from a bundle are specific to each SDK (for example, the Sybase CEP Java SDK vs. the Sybase CEP C/C++ SDK) and are discussed in more detail later.