This operator receives an POJO (Plain Old Java Object) as an incoming tuple and based on the filter condition it emits filtered tuples on one output port and rest on another output port.
Filter operator supports quasi Java expressions to specify filter rule.
Filter operator does not hold any state and is idempotent, fault-tolerant and statically/dynamically partitionable.
Property | Description | Type | Mandatory | Default Value |
---|---|---|---|---|
condition | condition/expression with which Filtering is done. | String | Yes | N/A |
additionalExpressionFunctions | List of import classes/method that should be made statically available to expression to use. | List<String> | No | Empty List |
Attribute | Description | Type | Mandatory |
---|---|---|---|
port.input.attr.TUPLE_CLASS | TUPLE_CLASS attribute on input port indicates the class of POJO which incoming tuple | Class or FQCN | Yes |
Port | Description | Type | Connection Required |
---|---|---|---|
input | Tuple which needs to be filtered are received on this port | Object (POJO) | Yes |
truePort | Tuples which satisfies condition are emitted on this port | Object (POJO) | No |
falsePort | Tuples which does not satisfy condition are emitted on this port | Object (POJO) | No |
Current FilterOperator
has following limitation:
Example for FilterOperator
can be found at: https://github.com/DataTorrent/examples/tree/master/tutorials/filter