Contents
This topic explains how the Filter operator works and the actions you can take on its Properties view.
The Filter operator accepts a single Input Stream and applies one or more predicates (tests) to the arriving tuples. A predicate returns TRUE or FALSE. If a tuple's data matches a TRUE condition in a predicate, it is moved onto a designated output stream. You can define a Filter operator so that tuples not matching any of the predicates are either dropped or sent to an output stream.
Use the Filter operator when you want to choose different processing of data
depending on some characteristic of the data. For example, if you wanted to create an
alert if a stock trade transaction exceeded a specified number of shares, then use a
predicate such as to send those tuples to a stream to do the
alert.
numShares
> threshold
Name: Use this field to specify or change the component's name, which must be unique in the application. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.
Enable Error Output Port: Check this checkbox to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports and Error Streams to learn about Error Ports.
Description: Optionally enter text to briefly describe the component's purpose and function. In the EventFlow canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.
The Predicate Settings tab allows you to specify one or more predicates (tests) to apply to the arriving tuples. A predicate returns TRUE or FALSE. If a tuple's data matches a TRUE condition in a predicate, it is moved onto a designated output stream.
Each predicate is a test to be performed on the input tuple. Predicates are evaluated in the order in which they appear. If the predicate evaluates to TRUE, the tuple is sent to the corresponding output stream; if not, the next predicate is evaluated. A tuple is sent only to the first stream whose predicate is matched. If the Create Output Port for Non-matching Tuples option is checked and no other expressions return TRUE, the tuple is sent to an additional output port. If this option is not selected, no tuple is emitted.
Use the Concurrency tab to specify separate threading for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.
Caution
Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.
-
In an operation that performs sorting, any tuple with a null value in the ordering field or in a Boolean expression, will be ignored.
-
If the evaluation of a predicate results in a NullValueException error, the tuple will be dropped.
-
If this component contains a Group Options tab, any null value in a Group By expression will be grouped.
For more information, see Using Nulls.
