{"record":{"id":"b1390150eb6e7a37","repo":"pentaho/pentaho-kettle","slug":"transformclassbase-exception-invalidfieldstype","errorCode":null,"errorMessage":"TransformClassBase.Exception.InvalidFieldsType","messagePattern":"TransformClassBase\\.Exception\\.InvalidFieldsType","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/TransformClassBase.java","lineNumber":652,"sourceCode":"          }\n          outFieldHelpers.put( name, fh );\n        }\n        break;\n      case Info:\n        fh = infoFieldHelpers.get( name );\n        if ( fh == null ) {\n          RowMetaInterface rmi = getTransMeta().getPrevInfoFields( getStepname() );\n          try {\n            fh = new FieldHelper( rmi, name );\n          } catch ( IllegalArgumentException e ) {\n            throw new KettleStepException( BaseMessages.getString(\n              PKG, \"TransformClassBase.Exception.UnableToFindFieldHelper\", type.name(), name ) );\n          }\n          infoFieldHelpers.put( name, fh );\n        }\n        break;\n      default:\n        throw new KettleStepException( BaseMessages.getString(\n          PKG, \"TransformClassBase.Exception.InvalidFieldsType\", type.name(), name ) );\n    }\n    return fh;\n  }\n\n  public Object[] createOutputRow( Object[] inputRow, int outputRowSize ) {\n    if ( meta.isClearingResultFields() ) {\n      return RowDataUtil.allocateRowData( outputRowSize );\n    } else {\n      return RowDataUtil.createResizedCopy( inputRow, outputRowSize );\n    }\n  }\n}\n","sourceCodeStart":634,"sourceCodeEnd":666,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/TransformClassBase.java#L634-L666","documentation":"Thrown by TransformClassBase.getFieldHelper when the requested Fields type is not one of In, Out, Info (or the handled enum cases). It signals an invalid/unknown field-lookup type combined with a field name, raised as KettleStepException.","triggerScenarios":"get(Fields.SomeType, name) with an enum member the base class does not handle — only possible via future/extended Fields enum values or reflection-driven/incorrect generated code paths.","commonSituations":"Using a newer Kettle Fields enum value against an older engine that doesn't implement that branch; custom/patched UDJC variants adding new field types; generated code referencing an invalid field type.","solutions":["Use only Fields.In, Fields.Out, or Fields.Info in UDJC scripts.","Upgrade or align the Pentaho Kettle engine version so it supports all Fields enum members your script uses.","Audit generated/copied script code for invalid Fields usages."],"exampleFix":"// before\nFieldHelper fh = get(Fields.Debug, \"x\"); // unsupported type\n// after\nFieldHelper fh = get(Fields.In, \"x\");","handlingStrategy":"type-guard","validationCode":"// restrict lookups to supported types in your script helpers\nSet<String> allowed = new HashSet<>(Arrays.asList(\"In\", \"Out\", \"Info\")); if (!allowed.contains(type.name())) throw new KettleStepException(\"Unsupported field type: \" + type.name());","typeGuard":"boolean isSupportedFieldType(Fields type) { return type == Fields.In || type == Fields.Out || type == Fields.Info; }","tryCatchPattern":"try { FieldHelper fh = get(type, name); ... } catch (KettleStepException e) { logError(\"Unsupported field type \" + type.name() + \" for \" + name, e); throw e; }","preventionTips":["Only use Fields.In/Out/Info in UDJC scripts","Match engine version to the Fields enum members used","Review generated/copied code for unsupported field types"],"tags":["kettle","udjc","invalid-enum","fieldhelper"],"backgroundTag":"invalid-enum-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}