pentaho/pentaho-kettle · error · KettleValueException
: I don't know how to convert a boolean to a timestamp.
Error message
: I don't know how to convert a boolean to a timestamp.
What it means
ValueMetaTimestamp.getTimestamp() refuses to convert Boolean source values: the TYPE_BOOLEAN case unconditionally throws this KettleValueException because PDI defines no boolean-to-timestamp mapping. The message is prefixed with the field's toString() so you can see which field was involved.
Solutions
- Align the metadata with the actual data: if the value is Boolean, keep the field type TYPE_BOOLEAN, or convert the source to a Timestamp-compatible type (String/Date) first with a 'Value Mapper' or 'Calculator' step.
- In code, branch on valueMeta.getType() and only call getTimestamp() for convertible types (String, Number, Integer, BigNumber, Date); handle Boolean explicitly with your own rule.
- If you own the data, change the upstream step so it emits a real timestamp (e.g. TODATE() or a Calculator conversion) instead of a boolean.
- As a last resort, subclass or wrap the ValueMeta and override getTimestamp() to define a custom boolean->timestamp mapping, though explicit pre-conversion is preferred.
Example fix
// before
Timestamp t = meta.getTimestamp( booleanObject ); // always throws
// after
if ( meta.getType() == ValueMetaInterface.TYPE_BOOLEAN ) {
Boolean b = meta.getBoolean( booleanObject );
Timestamp t = b != null && b ? new Timestamp( 0L ) : null; // explicit rule
} else {
Timestamp t = meta.getTimestamp( booleanObject );
} Defensive patterns
Strategy: type-guard
Validate before calling
if ( meta.getType() == ValueMetaInterface.TYPE_BOOLEAN ) {
// do not call getTimestamp(); convert the boolean explicitly first
} 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; // BOOLEAN, BINARY, SERIALIZABLE are not convertible
}
} Try / catch
try {
t = meta.getTimestamp( value );
} catch ( KettleValueException e ) {
if ( e.getMessage().contains( "convert a boolean to a timestamp" ) ) {
Boolean b = meta.getBoolean( value );
t = ( b != null && b ) ? new Timestamp( 0L ) : null; // explicit mapping
} else { throw e; }
} Prevention
- Check meta.getType() before calling getTimestamp().
- Convert boolean fields to String/Date upstream with a Calculator or Value Mapper step.
- Keep stream field types consistent between producing and consuming steps.
- Define your boolean->timestamp rule explicitly instead of relying on the library.
When it happens
Trigger: getTimestamp(object) invoked on a ValueMetaTimestamp whose internal type is TYPE_BOOLEAN, i.e. the value metadata claims the source data is a Boolean, regardless of storage type.
Common situations: A stream field previously Boolean was re-declared as Timestamp while data is still boolean; generic row-copying code that calls getTimestamp for every field without checking the declared type; merge/join steps mixing metadata from two sources with conflicting types.
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
- : it's not possible to convert from Timestamp to Boolean
- : I don't know how to convert a binary value to timestamp.
- : I don't know how to convert a serializable value to…
- : can't be converted to a timestamp
- Error converting data while looking up value
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/4834b94c62127d49.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java:186
return convertIntegerToTimestamp( (Long) convertBinaryStringToNativeType( (byte[]) object ) );
case STORAGE_TYPE_INDEXED:
return convertIntegerToTimestamp( (Long) index[ ( (Integer) object ).intValue() ] );
default:
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;View on GitHub (pinned to f3058517a1)