Pentaho Data Integration Cookbook - Second Edition - Second Edition
by Alex Meadows, Adrian Sergio Pulvirenti, María Carina Roldán
Programming custom functionality
In Kettle, you have a lot of functionality provided by the built-in steps, but if that is not enough for you, there is a step named User Defined Java Class where you can program custom functionality with Java code. In this way, you can accomplish complex tasks, access Java libraries, and even access the Kettle API. The code you type into this step is compiled once and executed at runtime for each passing row.
Let's create a simple example of the use of the UDJC step. Assume that you have a text file containing sentences; you want to count the words in each row and split the flow of data into two streams depending on the number of words per sentence.
Note that, in order to develop a more interesting exercise, we added ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access