How to add condition in Pentaho Spoon

28 Views Asked by At

I'm trying to insert a record from a .csv file that is not present in Table. How do I add a condition where it filters the record such that if it's present in the table, it would not be inserted?

Table

I added Java code where it reads the file columns and connects to the table to check the fields.

1

There are 1 best solutions below

0
Bert-Jan Stroop On

The easiest way is to use a "merge rows (diff)" step. In that you can have a main input and a reference input. It checks the main input versus the reference input, based on a configurable key, and then returns a flagfield for each record of the main input, saying it is either new, changed, unchanged or deleted in the existiong set. Then based on that flagfield (filter step afterwards for example) you can then set follow up steps.

an example: enter image description here