Filter
This topic describes how to use the filter operator and provides important notes.
Purpose
The filter operator filters data based on specified conditions and sends the results to the next node.
Scenarios
Compute link | Compute engine | Supported |
Offline | MaxCompute | Yes |
Hive | Yes | |
HiveStorage | Yes | |
RDS/MySQL | Yes |
Usage instructions
Filter condition
You can configure the filter conditions, such as "score > 80". Data that does not meet the conditions is filtered out and is not passed to the next node.
Filter conditions support logical operations, multiple levels of nesting, and expressions.
Output fields
By default, the output fields are inherited from the previous node. After the operator processes the data, you can configure which fields to output to the next node.
You can set an alias and a code alias for the output fields. Subsequent nodes use these aliases.
Sort results
You can sort the output results in ascending or descending order. Multiple criteria are supported, such as sorting by age in ascending order and by score in descending order. Sorting criteria also support expressions.
The node output also supports data truncation. For example, you can start from the 100th record and retrieve 1000 records.
This feature is available only in offline scenarios.
Notes
A filter operator must have exactly one parent node and can only filter the output of that parent node.
A filter condition is required and cannot be empty.