{"record":{"id":"b9c0abde7ca7d2e9","repo":"pentaho/pentaho-kettle","slug":"fieldsplitter-log-splitfieldnotvalid","errorCode":null,"errorMessage":"FieldSplitter.Log.SplitFieldNotValid","messagePattern":"FieldSplitter\\.Log\\.SplitFieldNotValid","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fieldsplitter/FieldSplitter.java","lineNumber":65,"sourceCode":"    super( stepMeta, stepDataInterface, copyNr, transMeta, trans );\n  }\n\n  private Object[] splitField( Object[] r ) throws KettleException {\n    if ( first ) {\n      first = false;\n      // get the RowMeta\n      data.previousMeta = getInputRowMeta().clone();\n\n      // search field\n      data.fieldnr = data.previousMeta.indexOfValue( meta.getSplitField() );\n      if ( data.fieldnr < 0 ) {\n        throw new KettleValueException( BaseMessages.getString(\n          PKG, \"FieldSplitter.Log.CouldNotFindFieldToSplit\", meta.getSplitField() ) );\n      }\n\n      // only String type allowed\n      if ( !data.previousMeta.getValueMeta( data.fieldnr ).isString() ) {\n        throw new KettleValueException( ( BaseMessages.getString(\n          PKG, \"FieldSplitter.Log.SplitFieldNotValid\", meta.getSplitField() ) ) );\n      }\n\n      // prepare the outputMeta\n      //\n      data.outputMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      // Now create objects to do string to data type conversion...\n      //\n      data.conversionMeta = data.outputMeta.cloneToType( ValueMetaInterface.TYPE_STRING );\n\n      data.delimiter = environmentSubstitute( meta.getDelimiter() );\n      data.enclosure = environmentSubstitute( meta.getEnclosure() );\n    }\n\n    // reserve room","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fieldsplitter/FieldSplitter.java#L47-L83","documentation":"FieldSplitter can only split string fields. After locating the split field, splitField checks valueMeta.isString(); if the field is numeric, date, or any non-String type, it throws this KettleValueException naming the field.","triggerScenarios":"The configured split field exists in the input row but its runtime type is not String (e.g. Integer, Number, Date).","commonSituations":"Upstream source types changed (CSV auto-detect now returns Number); a 'Select values' step converts the field to a numeric type before splitting; database column changed to numeric.","solutions":["Add a 'Select values' step (or String conversion) before FieldSplitter to convert the field to String","Change the upstream source so the field is emitted as String","Update the step metadata so the type expectation matches the stream"],"exampleFix":"// before: split field 'amount' (Number) goes straight into FieldSplitter\n// after: insert 'Select values' step converting 'amount' to String, then FieldSplitter","handlingStrategy":"validation","validationCode":"// ensure the split field is a String before splitting\nValueMetaInterface vm = inputRowMeta.indexOfValue(splitField) >= 0\n  ? inputRowMeta.getValueMeta(inputRowMeta.indexOfValue(splitField)) : null;\nif (vm == null || !vm.isString()) {\n  throw new IllegalArgumentException(\"Split field must be String: \" + splitField);\n}","typeGuard":"boolean isSplittableString(RowMetaInterface rm, String name) {\n  int idx = rm.indexOfValue(name);\n  return idx >= 0 && rm.getValueMeta(idx).isString();\n}","tryCatchPattern":"try { row = splitStep.splitField(row); }\ncatch (KettleValueException e) { sendToErrorHandlingStream(row, e); }","preventionTips":["Insert a 'Select values' String conversion before FieldSplitter when sources emit typed data","Check field types with a preview after upstream changes","Declare CSV/text source fields as String when they feed a splitter"],"tags":["pdi","transformation","type-safety"],"backgroundTag":"type-mismatch","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"}