pentaho/pentaho-kettle · error · KettleValueException

: it's not possible to convert from Timestamp to Boolean

Error message

: it's not possible to convert from Timestamp to Boolean

What it means

ValueMetaTimestamp.getBoolean() is deliberately unimplemented in PDI (Kettle): the library refuses to implicitly convert a java.sql.Timestamp value to a Boolean because such a conversion has no well-defined semantics. Instead of guessing (e.g. non-null=true), it throws a KettleValueException with a message built from the field's meta description. Any row-processing step that calls getBoolean() on a Timestamp-typed field will hit this.

Solutions

  1. Convert explicitly before calling getBoolean: wrap the value with a conversion step or call valueMeta.getString(object)/getTimestamp(object) and apply your own rule (e.g. non-null -> true).
  2. Change the reading code to request the value as String or Timestamp via getString()/getTimestamp() and parse to Boolean with explicit logic.
  3. If the field should actually be Boolean, fix the field's declared type (ValueMetaInterface setType(TYPE_BOOLEAN) or correct the table/stream definition) so ValueMetaBoolean.getBoolean() is used instead.
  4. If only null must pass, guard with if (object == null) before calling getBoolean(), since null returns null without throwing (see getBoolean's null check above line 117).

Example fix

// before
Boolean b = timestampMeta.getBoolean( rowValue ); // throws
// after
Boolean b = null;
if ( rowValue != null ) {
  Timestamp ts = timestampMeta.getTimestamp( rowValue );
  b = ts != null; // explicit rule chosen by the developer
}
Defensive patterns

Strategy: validation

Validate before calling

if ( object != null && meta.getType() == ValueMetaInterface.TYPE_TIMESTAMP ) {
  // convert via getTimestamp()/getString() with an explicit rule instead of getBoolean()
}

Type guard

boolean isBooleanConvertible( ValueMetaInterface meta, Object v ) {
  return v == null || meta.getType() == ValueMetaInterface.TYPE_BOOLEAN;
}

Try / catch

try {
  b = meta.getBoolean( value );
} catch ( KettleValueException e ) {
  if ( e.getMessage().contains( "not possible to convert from Timestamp to Boolean" ) ) {
    b = meta.getTimestamp( value ) != null; // explicit fallback rule
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling ValueMetaInterface.getBoolean(object) on a metadata instance whose type is TYPE_TIMESTAMP (ValueMetaTimestamp), regardless of storage type, even when the object is non-null. Typical call path: a step or transformation calls row.getBoolean(field) while the field was declared as Timestamp.

Common situations: A transformation field type changed from Boolean/String to Timestamp (e.g. after a database column or CSV type change) while downstream steps still read it as boolean; generic code that copies row data calling getBoolean for every field; unit tests like testConvertTimestampToBoolean_Null documenting that only null is safe.

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/bb406d35e8455d0b. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java:117

      return timestampAsInteger.doubleValue();
    } else {
      return null;
    }
  }

  @Override
  public BigDecimal getBigNumber( Object object ) throws KettleValueException {
    Long timestampAsInteger = getInteger( object );
    if ( null != timestampAsInteger ) {
      return BigDecimal.valueOf( timestampAsInteger );
    } else {
      return null;
    }
  }

  @Override
  public Boolean getBoolean( Object object ) throws KettleValueException {
    throw new KettleValueException( toStringMeta() + ": it's not possible to convert from Timestamp to Boolean" );
  }

  @Override
  public String getString( Object object ) throws KettleValueException {
    return convertTimestampToString( getTimestamp( object ) );
  }

  public Timestamp getTimestamp( Object object ) throws KettleValueException {
    if ( object == null ) {
      return null;
    }
    switch ( type ) {
      case TYPE_TIMESTAMP:
        switch ( storageType ) {
          case STORAGE_TYPE_NORMAL:
            return (Timestamp) object;
          case STORAGE_TYPE_BINARY_STRING:
            return (Timestamp) convertBinaryStringToNativeType( (byte[]) object );

View on GitHub (pinned to f3058517a1)