Search code examples
pentahouuid

Pentaho - Generate UUID based on input fields


Is there a way to generate UUID in pentaho step using input fields?

Example:

Input: Name, Address.
Output: UUID = UUID(Name + Address)

Solution

  • You can add a user defined java class and use a code similar to this:

    String input = "Some name" + "Some address";
    byte[] serialized = input.getBytes("UTF8");
    UUID yourId = UUID.nameUUIDFromBytes(serialized);
    

    This will generate a deterministic UUID based on the given input you have.