December 2017
Beginner to intermediate
500 pages
12h 10m
English
With the Java Class step, you control which rows go to the next step using the putRow() method. With this method selectively, you decide which rows to send and which rows to discard.
As an example, if we want to apply a filter and keep only the words with length greater than three, we could move the putRow() function inside an if clause, as shown in the following sample:
if (len_word > 3) { putRow(data.outputRowMeta, outputRow); }
Your final code should look as follows:
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException { Object[] r = getRow(); if (r == null) { setOutputDone(); return false; } if (first) { first = false;} Object[] outputRow ...Read now
Unlock full access