pentaho/pentaho-kettle · error · KettleValueException
: I don't know how to convert a serializable value to…
Error message
: I don't know how to convert a serializable value to timestamp.
What it means
getTimestamp() has no conversion defined for TYPE_SERIALIZABLE source values and throws this KettleValueException unconditionally for that case. Serializable-typed fields (arbitrary Java objects passed between steps) cannot be interpreted as timestamps by the generic value-meta machinery.
Solutions
- Give the field a concrete type (TYPE_DATE/TYPE_TIMESTAMP or TYPE_STRING) instead of TYPE_SERIALIZABLE when its values are timestamps.
- If the object truly is a timestamp holder, extract it explicitly: Timestamp t = (Timestamp) ((MyHolder) object).getValue(); and skip the value-meta conversion.
- Set the metadata type in the producing step (meta.setType(ValueMetaInterface.TYPE_TIMESTAMP)) so downstream getTimestamp() uses the supported path.
- In generic row-processing code, check meta.getType() and skip TYPE_SERIALIZABLE fields rather than attempting conversion.
Example fix
// before ValueMeta meta = new ValueMeta( "obj", ValueMetaInterface.TYPE_SERIALIZABLE ); Timestamp t = meta.getTimestamp( object ); // throws // after ValueMeta meta = new ValueMeta( "obj", ValueMetaInterface.TYPE_TIMESTAMP ); Timestamp t = meta.getTimestamp( object ); // uses STORAGE_TYPE_NORMAL path
Defensive patterns
Strategy: type-guard
Validate before calling
if ( meta.getType() == ValueMetaInterface.TYPE_SERIALIZABLE ) {
// extract the object yourself; getTimestamp() will throw
} Type guard
boolean isTimestampConvertible( ValueMetaInterface meta ) {
switch ( meta.getType() ) {
case ValueMetaInterface.TYPE_TIMESTAMP:
case ValueMetaInterface.TYPE_DATE:
case ValueMetaInterface.TYPE_STRING:
case ValueMetaInterface.TYPE_NUMBER:
case ValueMetaInterface.TYPE_INTEGER:
case ValueMetaInterface.TYPE_BIGNUMBER:
return true;
default:
return false;
}
} Try / catch
try {
t = meta.getTimestamp( value );
} catch ( KettleValueException e ) {
if ( e.getMessage().contains( "convert a serializable value to timestamp" ) ) {
t = ( value instanceof Timestamp ) ? (Timestamp) value : null;
} else { throw e; }
} Prevention
- Set a concrete type (TYPE_TIMESTAMP/TYPE_STRING) instead of TYPE_SERIALIZABLE for timestamp-bearing fields.
- In UDJC or plugin steps, always assign an explicit value-meta type to output fields.
- Skip SERIALIZABLE fields in generic conversion loops.
- Cast to Timestamp directly when you know the serialized object's runtime type.
When it happens
Trigger: Calling getTimestamp(object) on a ValueMetaTimestamp whose type is TYPE_SERIALIZABLE — i.e. the field holds a serialized Java object rather than a scalar convertible type.
Common situations: User-defined Java classes flowing through rows (e.g. from UDJC steps) later read as timestamps; metadata where the type defaulted to SERIALIZABLE because the plugin never set a concrete type; mapping fields between transformations with mismatched type declarations.
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
- : I don't know how to convert a binary value to timestamp.
- : I don't know how to convert a boolean to a timestamp.
- : I don't know how to convert a serializable value to…
- : I don't know how to convert serializable values to…
- : it's not possible to convert from Timestamp to Boolean
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/90e9de758c5c848a.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java:190
throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
}
case TYPE_BIGNUMBER:
switch ( storageType ) {
case STORAGE_TYPE_NORMAL:
return convertBigNumberToTimestamp( (BigDecimal) object );
case STORAGE_TYPE_BINARY_STRING:
return convertBigNumberToTimestamp( (BigDecimal) convertBinaryStringToNativeType( (byte[]) object ) );
case STORAGE_TYPE_INDEXED:
return convertBigNumberToTimestamp( (BigDecimal) index[ ( (Integer) object ).intValue() ] );
default:
throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
}
case TYPE_BOOLEAN:
throw new KettleValueException( toString() + " : I don't know how to convert a boolean to a timestamp." );
case TYPE_BINARY:
throw new KettleValueException( toString() + " : I don't know how to convert a binary value to timestamp." );
case TYPE_SERIALIZABLE:
throw new KettleValueException( toString()
+ " : I don't know how to convert a serializable value to timestamp." );
default:
throw new KettleValueException( toString() + " : Unknown type " + type + " specified." );
}
}
public int compare( Object data1, Object data2 ) throws KettleValueException {
Timestamp timestamp1 = getTimestamp( data1 );
Timestamp timestamp2 = getTimestamp( data2 );
int cmp = 0;
if ( timestamp1 == null ) {
if ( timestamp2 == null ) {
cmp = 0;
} else {
cmp = -1;
}
} else if ( timestamp2 == null ) {View on GitHub (pinned to f3058517a1)