Dear Kettle fans,
Daniel & I had a lot of fun in Orlando last week. Among other things we worked on the User Defined Java Class (UDJC) step.* If you have a bit of Java Experience, this step allows you to quickly write your own plugin in a step. This step is available in recent builds of Pentaho Data Integration (Kettle) version 4.
Now, how does this work?* Well, let’s take
Roland Bouman’s example :
the calculation of the the date of Easter.* In this blog post, Roland explains how to calculate Easter in MySQL and Kettle using JavaScript.* OK, so what if you want this calculation to be really fast in Kettle?* Well, then you can turn to pure Java to do the job…
import java.util.*;private int yearIndex;private Calendar calendar;public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException{Object[] r=getRow();if (r==null){setOutputDone();return false;}if (first) {yearIndex = getInputRowMeta().indexOfValue(getParameter("YEAR"));if (yearIndex