pentaho/pentaho-kettle · error · KettleValueException

FieldSplitter.Log.SplitFieldNotValid

Error message

FieldSplitter.Log.SplitFieldNotValid

What it means

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.

Solutions

  1. Add a 'Select values' step (or String conversion) before FieldSplitter to convert the field to String
  2. Change the upstream source so the field is emitted as String
  3. Update the step metadata so the type expectation matches the stream

Example fix

// before: split field 'amount' (Number) goes straight into FieldSplitter
// after: insert 'Select values' step converting 'amount' to String, then FieldSplitter
Defensive patterns

Strategy: validation

Validate before calling

// ensure the split field is a String before splitting
ValueMetaInterface vm = inputRowMeta.indexOfValue(splitField) >= 0
  ? inputRowMeta.getValueMeta(inputRowMeta.indexOfValue(splitField)) : null;
if (vm == null || !vm.isString()) {
  throw new IllegalArgumentException("Split field must be String: " + splitField);
}

Type guard

boolean isSplittableString(RowMetaInterface rm, String name) {
  int idx = rm.indexOfValue(name);
  return idx >= 0 && rm.getValueMeta(idx).isString();
}

Try / catch

try { row = splitStep.splitField(row); }
catch (KettleValueException e) { sendToErrorHandlingStream(row, e); }

Prevention

When it happens

Trigger: The configured split field exists in the input row but its runtime type is not String (e.g. Integer, Number, Date).

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

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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

Appendix: source

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

    super( stepMeta, stepDataInterface, copyNr, transMeta, trans );
  }

  private Object[] splitField( Object[] r ) throws KettleException {
    if ( first ) {
      first = false;
      // get the RowMeta
      data.previousMeta = getInputRowMeta().clone();

      // search field
      data.fieldnr = data.previousMeta.indexOfValue( meta.getSplitField() );
      if ( data.fieldnr < 0 ) {
        throw new KettleValueException( BaseMessages.getString(
          PKG, "FieldSplitter.Log.CouldNotFindFieldToSplit", meta.getSplitField() ) );
      }

      // only String type allowed
      if ( !data.previousMeta.getValueMeta( data.fieldnr ).isString() ) {
        throw new KettleValueException( ( BaseMessages.getString(
          PKG, "FieldSplitter.Log.SplitFieldNotValid", meta.getSplitField() ) ) );
      }

      // prepare the outputMeta
      //
      data.outputMeta = getInputRowMeta().clone();
      meta.getFields( getTransMeta().getBowl(), data.outputMeta, getStepname(), null, null, this, repository,
        metaStore );

      // Now create objects to do string to data type conversion...
      //
      data.conversionMeta = data.outputMeta.cloneToType( ValueMetaInterface.TYPE_STRING );

      data.delimiter = environmentSubstitute( meta.getDelimiter() );
      data.enclosure = environmentSubstitute( meta.getEnclosure() );
    }

    // reserve room

View on GitHub (pinned to f3058517a1)