Search code examples
mysqlpentahokettle

Pentaho Kettle scripting option


I am trying to use the Pentaho Kettle software for a few transformations on my largetables. I want to perform an operation that displays the contents of alternate rows in two different tables and then I wish to join the two tables later for further transformation.

The scripting option in the tool helps me with the executing SQL scripts for single row or multiple rows. Can anyone help me with how to select the row for this purpose.


Solution

  • It's not very clear what your trying to achieve, but the individual elements are pretty straight forward when you break them down to their discrete steps.

    I would use the following steps:

    • Table Input - allows you to make a query to a database connection with a SQL statement.
    • Filter Rows - allows you to split a row of data to two separate paths based on selected criteria in the data row.

    You can achieve union of two or more separate paths by connecting them to any step type; that is, a step will process each data row from any number of input paths separately and send it down the output path. In affect, all steps perform union operations.

    One critical principle to keep in mind when using Pentaho Kettle is never assume that operations happen sequentially (i.e. process 1st row, then 2nd, then 3rd, etc.). Operations happen in parallel by data row; so the 1st row can be sent down the path after the 2nd row.

    Hope that helps...