Search code examples
javapentahokettle

Access added Kettle data type from the source of a step


Following the answer on my previous question (Add a new data type to Pentaho Kettle), I added a plugin with a custom datatype. Now I have a step where I need to access this custom data type from ValueMeta as in ValueMeta.TYPE_CUSTOMTYPE for the getFields() method. I can't get that to work. Your ideas would be appreciated.

PS: I cannot have the code for the custom DT in the step code as the same DT would be used by several steps.

Thanks.


Solution

  • Take a look at ValueMetaFactory, there are methods in there to retrieve ValueMeta types by name or integer type:

    https://github.com/pentaho/pentaho-kettle/blob/master/core/src/org/pentaho/di/core/row/value/ValueMetaFactory.java#L133