pentaho/pentaho-kettle · error · KettleValueException

FieldSplitter.Log.ErrorConvertingSplitValue

Error message

FieldSplitter.Log.ErrorConvertingSplitValue

What it means

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.

Solutions

  1. Correct the data or the delimiter/enclosure settings so tokens align with declared types
  2. Relax target field types to String if values may not be parseable
  3. Set null-if / default-if-null values in the step so empty or invalid tokens map to null
  4. Pre-validate with a 'Filter rows' or 'If field value is null' step

Example fix

// before: field[0] declared Integer, data '1,2,x' -> conversion throws
// after: set field[0] nullIf="" and ifNull="0", or declare field[0] as String and convert later
Defensive patterns

Strategy: validation

Validate before calling

// pre-validate tokens against target types before conversion
// e.g. for a Number target:
String token = pieces[i];
boolean ok = token == null || token.isEmpty() || token.matches("-?\\d+(\.\\d+)?");
if (!ok) { routeToErrorRow(token); }

Try / catch

try { row = splitStep.splitField(row); }
catch (KettleValueException e) {
  log.warn("Bad split value: {}", e.getMessage());
  sendToErrorStream(row, e);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/661f816c86aaca94. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/fieldsplitter/FieldSplitter.java:153

        if ( log.isDebug() ) {
          logDebug( BaseMessages
            .getString( PKG, "FieldSplitter.Log.SplitFieldsInfo", rawValue, String.valueOf( prev ) ) );
        }
      }

      Object value;
      try {
        ValueMetaInterface valueMeta = data.outputMeta.getValueMeta( data.fieldnr + i );
        ValueMetaInterface conversionValueMeta = data.conversionMeta.getValueMeta( data.fieldnr + i );

        if ( rawValue != null && valueMeta.isNull( rawValue ) ) {
          rawValue = null;
        }
        value =
          valueMeta.convertDataFromString( rawValue, conversionValueMeta, meta.getFieldNullIf()[ i ],
            meta.getFieldIfNull()[ i ], meta.getFieldTrimType()[ i ] );
      } catch ( Exception e ) {
        throw new KettleValueException( BaseMessages.getString(
          PKG, "FieldSplitter.Log.ErrorConvertingSplitValue", rawValue, meta.getSplitField() + "]!" ), e );
      }
      outputRow[ data.fieldnr + i ] = value;
    }

    return outputRow;
  }

  public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
    meta = (FieldSplitterMeta) smi;
    data = (FieldSplitterData) sdi;

    Object[] r = getRow(); // get row from rowset, wait for our turn, indicate busy!
    if ( r == null ) {
      // no more input to be expected...
      setOutputDone();

      return false;

View on GitHub (pinned to f3058517a1)