pentaho/pentaho-kettle · error · KettleValueException

: I don't know how to convert serializable values to…

Error message

 : I don't know how to convert serializable values to integers.

What it means

ValueMetaBase.getInteger() refuses to convert values whose metadata type is TYPE_SERIALIZABLE (arbitrary Java objects) to a Long. No meaningful generic object-to-integer conversion exists, so KettleValueException is thrown. It signals that the field holds a serialized/plain Java object and numeric access is not supported.

Solutions

  1. Give the field a concrete numeric type (TYPE_INTEGER/TYPE_NUMBER) and put a numeric value in it
  2. If the object has a numeric property, extract and convert it explicitly before calling getInteger
  3. Inspect the row metadata (rowMeta.getValueMeta(i).getType()) and avoid numeric access for serializable fields; filter them out or pass them opaquely

Example fix

// before
ValueMetaInterface meta = new ValueMetaBase("obj", ValueMetaInterface.TYPE_SERIALIZABLE);
Long n = meta.getInteger(object); // throws
// after
if (meta.getType() == ValueMetaInterface.TYPE_SERIALIZABLE) {
  MyThing t = (MyThing) object;
  Long n = t.getCount(); // extract the numeric yourself
}
Defensive patterns

Strategy: validation

Validate before calling

if (meta.getType() == ValueMetaInterface.TYPE_SERIALIZABLE) {
  throw new IllegalArgumentException("Field " + meta.getName() + " holds objects; no numeric conversion");
}
Long n = meta.getInteger(object);

Type guard

boolean isSerializable(ValueMetaInterface m) {
  return m.getType() == ValueMetaInterface.TYPE_SERIALIZABLE;
}

Try / catch

try {
  Long n = meta.getInteger(object);
} catch (KettleValueException e) {
  log.warn("Skipping serializable field " + meta.getName() + ": " + e.getMessage());
  n = null;
}

Prevention

When it happens

Trigger: Calling getInteger(Object) on a ValueMetaBase configured with type ValueMetaInterface.TYPE_SERIALIZABLE and a non-null object. Typical when rows carry custom objects (e.g. Kettle metadata objects) between steps and a downstream step tries numeric access.

Common situations: Steps passing POJOs or metadata objects (like ValueMeta itself, database connections) through the row stream; user-defined Java class step outputting objects; incorrectly configured field type on a UserDefinedJavaClass or custom plugin step.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java:2130

              return new Long( ( (BigDecimal) index[( (Integer) object ).intValue()] ).longValue() );
            default:
              throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_BOOLEAN:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              return convertBooleanToInteger( (Boolean) object );
            case STORAGE_TYPE_BINARY_STRING:
              return convertBooleanToInteger( (Boolean) convertBinaryStringToNativeType( (byte[]) object ) );
            case STORAGE_TYPE_INDEXED:
              return convertBooleanToInteger( (Boolean) index[( (Integer) object ).intValue()] );
            default:
              throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_BINARY:
          throw new KettleValueException( toString() + " : I don't know how to convert binary values to integers." );
        case TYPE_SERIALIZABLE:
          throw new KettleValueException( toString()
              + " : I don't know how to convert serializable values to integers." );
        default:
          throw new KettleValueException( toString() + " : Unknown type " + type + " specified." );
      }
    } catch ( Exception e ) {
      throw new KettleValueException( "Unexpected conversion error while converting value [" + toString()
          + "] to an Integer", e );
    }
  }

  @Override
  public BigDecimal getBigNumber( Object object ) throws KettleValueException {
    try {
      if ( isNull( object ) ) {
        return null;
      }
      switch ( type ) {
        case TYPE_BIGNUMBER:

View on GitHub (pinned to f3058517a1)