How to filter rows in Apache Hop
What this shows
Filter Rows sends each row down one of two paths, depending on whether a condition holds. It is how you split a stream in Apache Hop: matching rows go one way, everything else goes the other.
Reference documentationThe complete list of Filter Rows options is documented in the Apache Hop manual, which is the authoritative reference.hop.apache.org →Sample pipeline
The pipeline in the video is Apache Hop's own sample, filter-rows-basic.hpl, which ships in the Hop samples project under transforms/.
Transcript
Full transcript
Filter Rows sends each row down one of two paths, depending on whether a condition holds. It is how you split a stream in Apache Hop: matching rows go one way, everything else goes the other.
This pipeline starts with ten rows of test data, each with an id, a description and a group. Two Filter Rows transforms read the same rows and route them differently.
The condition reads: id less than five, or group equals GR03, and not description equals d. Brackets group the first two, so the whole expression is one nested condition rather than a flat list. Click a value to change it, or the plus sign on the right to add another line.
These two fields decide where rows go. Rows matching the condition are sent to True Output, and the rest to False Output. Both are ordinary transforms on the canvas - Filter Rows does not do anything to the rows themselves, it only chooses their direction.
The second Filter Rows shows you do not have to use both outputs. Only the true target is set here, so rows that fail the condition are simply dropped.
Running the pipeline sends all ten rows through both filters.
Five rows satisfied the condition and arrived at True Output; the other five went to False Output. Notice that the filter itself reports ten rows written and none captured - a transform that routes to named targets does not expose its output rows directly, so you read the split from the transforms on the receiving end.