Search code examples
pentahokettlepentaho-spoon

Pentaho Kettle: changing meta at run-time


I wonder if Kettle (AKA Pentaho PDI) supports metadata changing at run-time.

I've implemented a couple of custom plugins:

  • The first plugin sends data to the second plugin. The metadata of the rows sent in output can change when some conditions occur. In practice, this means that processRow() starts with a certain metadata and then, after a while, it changes it. Of course, the row sent in output through putRow() is always synchronized with the related metadata.
  • The second plugin receives data from the first plugin, calling getInputRowMeta() for understanding the metadata of the received row. However, such metadata seems to not be synchronized with the received row.

Given the results of this simple example, I wonder if the Kettle engine supports this kind of run-time behavior --- i.e. if getInputRowMeta() returns the correct metadata for the specific row that has been received.

Is anybody able of providing evidence that metadata changing is actually not possible ? Otherwise, is there any safe way for getting the metadata of the specific row received in processRow() ?


Solution

  • From page 616 of the book Pentaho Kettle Solutions:

    The calculation of the output row metadata is something that needs to happen once and only once because the layout of all the output rows needs to be the same.