{"record":{"id":"661f816c86aaca94","repo":"pentaho/pentaho-kettle","slug":"fieldsplitter-log-errorconvertingsplitvalue","errorCode":null,"errorMessage":"FieldSplitter.Log.ErrorConvertingSplitValue","messagePattern":"FieldSplitter\\.Log\\.ErrorConvertingSplitValue","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fieldsplitter/FieldSplitter.java","lineNumber":153,"sourceCode":"        if ( log.isDebug() ) {\n          logDebug( BaseMessages\n            .getString( PKG, \"FieldSplitter.Log.SplitFieldsInfo\", rawValue, String.valueOf( prev ) ) );\n        }\n      }\n\n      Object value;\n      try {\n        ValueMetaInterface valueMeta = data.outputMeta.getValueMeta( data.fieldnr + i );\n        ValueMetaInterface conversionValueMeta = data.conversionMeta.getValueMeta( data.fieldnr + i );\n\n        if ( rawValue != null && valueMeta.isNull( rawValue ) ) {\n          rawValue = null;\n        }\n        value =\n          valueMeta.convertDataFromString( rawValue, conversionValueMeta, meta.getFieldNullIf()[ i ],\n            meta.getFieldIfNull()[ i ], meta.getFieldTrimType()[ i ] );\n      } catch ( Exception e ) {\n        throw new KettleValueException( BaseMessages.getString(\n          PKG, \"FieldSplitter.Log.ErrorConvertingSplitValue\", rawValue, meta.getSplitField() + \"]!\" ), e );\n      }\n      outputRow[ data.fieldnr + i ] = value;\n    }\n\n    return outputRow;\n  }\n\n  public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n    meta = (FieldSplitterMeta) smi;\n    data = (FieldSplitterData) sdi;\n\n    Object[] r = getRow(); // get row from rowset, wait for our turn, indicate busy!\n    if ( r == null ) {\n      // no more input to be expected...\n      setOutputDone();\n\n      return false;","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fieldsplitter/FieldSplitter.java#L135-L171","documentation":"For each delimiter-derived token, FieldSplitter converts the raw string to the target field's declared type via valueMeta.convertDataFromString. If conversion fails (e.g. non-numeric text for a Number target), it throws this KettleValueException showing the offending raw value and split field.","triggerScenarios":"A split token cannot be parsed into the declared type of the i-th output field — e.g. the piece is \"abc\" but the target field is Integer, or the token is in an unexpected date format.","commonSituations":"Free-form source data containing empty strings, signs, or locale-specific formats; declared output types too strict for real data; wrong delimiter causing misaligned tokens (numeric field receives a text token).","solutions":["Correct the data or the delimiter/enclosure settings so tokens align with declared types","Relax target field types to String if values may not be parseable","Set null-if / default-if-null values in the step so empty or invalid tokens map to null","Pre-validate with a 'Filter rows' or 'If field value is null' step"],"exampleFix":"// before: field[0] declared Integer, data '1,2,x' -> conversion throws\n// after: set field[0] nullIf=\"\" and ifNull=\"0\", or declare field[0] as String and convert later","handlingStrategy":"validation","validationCode":"// pre-validate tokens against target types before conversion\n// e.g. for a Number target:\nString token = pieces[i];\nboolean ok = token == null || token.isEmpty() || token.matches(\"-?\\\\d+(\\.\\\\d+)?\");\nif (!ok) { routeToErrorRow(token); }","typeGuard":null,"tryCatchPattern":"try { row = splitStep.splitField(row); }\ncatch (KettleValueException e) {\n  log.warn(\"Bad split value: {}\", e.getMessage());\n  sendToErrorStream(row, e);\n}","preventionTips":["Configure null-if and if-null defaults in the step dialog","Use lenient target types (String) and convert later with controlled error handling","Preview data to check delimiter alignment before production runs"],"tags":["pdi","transformation","data-conversion"],"backgroundTag":"invalid-argument-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"}