Skip to main content

Pentaho+ documentation has moved!

The new product documentation portal is here. Check it out now at


Hitachi Vantara Lumada and Pentaho Documentation

Java filter


Parent article

The Java filter step refines a transformation data stream using a Java expression to set up conditional processing.

Transformation using the Java filter step

As shown in the sample transformation above, the output stream from the Data grid step is processed by the Java filter step. Based on the specified condition, the Java filter step sends matching data to the true step and non-matching data to the false step. Below is the condition used in this sample transformation.

if( condition)
{matching step}

{non-matching step}



Enter the following information in the transformation step name field.

  • Step Name: Specifies the unique name of the transformation step on the canvas. The Step Name is set to Java filter by default.




The Java filter step includes the following settings:

Option Description
Destination step for matching rows (optional) Specify the name of the step to receive rows evaluated as matching by the Condition (Java expression) option.
Destination step for non-matching rows (optional) Specify the name of the step to receive rows evaluated as non-matching by the Condition (Java expression) option.
Condition (Java expression) Specify a Java expression for filtering the data. See Filter expression examples for code samples.

Filter expression examples


Below are examples of Java expressions that you can use to filter data in the Condition (Java expression) option.


  • Filters a string that contains white space:
    .contains(" ");
  • Filters a string that is identical to a constant string:
  • Filters a Boolean value: