FieldHelper cannot be cast to java.lang.String pentaho

I had the following error in a “User Defined Java Class” step on Pentaho Data Integration.

FieldHelper cannot be cast to java.lang.String

Indeed, you have to use the getRow() method to convert the field you’re getting into a String or any other variable type.

public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException, Exception
{
  Object[] r = getRow();
        if (r == null) { return false; }
        String myString = get(Fields.In, "FeedSubmissionId").getString(r);
}

 


Couple of books to read for a developer

Some co-workers recommended me some development books. I added comments in the This list will be updated and feel free to add your suggestions in the comments 🙂