- Index

< Previous |  | Next >

# Aggregate Operator: Tuple-Based Dimension Options

In the Edit Dimension dialog, from the Type drop-down list, select Tuple to specify a tuple-based dimension to open a dialog that looks similar to the following example.

With a tuple-based dimension, a new window is opened and evaluated based on a specified number of arriving tuples. That is, a tuple containing the results of this operator's aggregation is emitted and the current window is closed when it contains a specified number of tuples. You can specify numbers of tuples as a number or a constant parameter.

The following describes the options available in the Edit Dimension dialog for tuple-based dimensions.

Category | Options and Meaning
--- | ---
Opening policy | Select one of these options: Do not open window based on this dimension — Default. When selected, this dimension cannot cause the opening of a new window for this Aggregate operator. Note that a window will in fact open when the first tuple arrives if no other dimension has opened a window, as there must always be an open window to receive tuples. Open per `[number]` tuples — Specify a number, a constant, or a simple expression that evaluates to a positive integer to define the number of tuples that will cause a new window to open. Think of this setting as a slider for multiple sliding windows. It is a typechecking error to try to specify a value for Open per that is greater than the value of Window size. The Offset option does not apply to tuple-based Aggregates and is always shown dimmed.
Window size | Select one of these options: Do not close window based on this dimension — Default. When selected, this dimension cannot cause the closing of a new window for this Aggregate operator. If a new window is never opened, and Do not close is selected, this creates an unlimited size window that never closes for the life of the StreamBase Server instance. Close and emit after `[number]` tuples — Specify a number, a constant, or a simple expression that evaluates to a positive integer to define the number of tuples each window can contain. When this number of tuples is exceeded, the window is closed and an aggregation results tuple is emitted. Note that the same result can be achieved in a Predicate dimension by placing the expression `count()==`number`` in the Close if field.
Emission policy | Select one of these options: No intermediate emissions based on this dimension — Default. When selected, this dimension does not force the emission of any intermediate results tuples. Intermediate emission every `[number]` tuples — When selected, this setting can cause tuples to be emitted before the window closes. number can be a number, a constant, or a simple expression that evaluates to a positive integer. For example, if you set number to 2, the operator could output a tuple for every second tuple that arrives within a 30-tuple window, instead of waiting for 30 tuples to arrive and produce a close event. Note that the same result can be achieved in a Predicate dimension by placing the expression `count()==`number`` in the Emit if field.
Optional windows | Open partial windows before first tuple — When this check box is cleared (the default setting), then the first tuple received is put into a window that will only close or emit for this dimension when the window contains the full number of tuples expressed in the emit or close configuration for this dimension. The window may emit or close if the emit or close criteria of other dimensions are satisfied. If this check box is checked, and this dimension's Open per advance value is less than its Window size value, then the first tuple received is put into all the windows it would have been put in if there had been previous events to open them. For example, if the Window size is 3 and the Advance is 1, then the first tuple will but put into five windows, one closing after the first tuple with just this first tuple in it, one closing after the second tuple with two tuples in it, and the third window closing after the third tuple with three tuples in it. If Group By Fields are specified in the Group Options tab and this check box is checked, then partial windows are opened for each unique combination of values of all the Group By fields.

Back to Top ^