In the Aggregate operator Dimensions tab you can open the Edit Dimension dialog to add, edit, or remove dimensions from the Aggregate operator. With a predicate-based dimension, new windows are opened, emitted from, and closed based on the evaluation of a predicate expression. You can define separate expressions to open, emit from, and close windows. The close window predicate is required for all windows, while the open and emit predicates are options.
The predicate-based dimension is best understood by running the sample provided in the
operators sample group. See Aggregate Operator Predicate
Dimension Sample.
The following table describes the options available in the Edit Dimension dialog for predicate-based dimensions. When you select Predicate in the Type field, all controls in the dialog are dimmed except the three in this table.
For all three fields, the current tuple is available to the expression as input1.*.
TYPE = Predicate
| Category | Required? | Description |
|---|---|---|
| Open | No |
Enter an expression that will be evaluated in a non-aggregate context. If you
enter an expression in this field, an aggregate window is opened only when this expression evaluates to true. If this field is left empty, an aggregate window is
opened whenever a tuple arrives and there is no active window (that is, when
the first tuple arrives and after the previous window closed).
|
| Emit | No |
Enter an expression that will be evaluated in an aggregate context. If you
enter an expression in this field, the current window emits a tuple
only when this expression evaluates to
true. If this field is left empty, a window
emits when it closes.
|
| Close | Yes |
Enter an expression that will be evaluated in an aggregate context. You must
enter an expression in this field. The current window closes only when this expression evaluates to true.
|
