pentaho/pentaho-kettle · error · KettleValueException

: I don't know how to convert date values to booleans.

Error message

 : I don't know how to convert date values to booleans.

What it means

ValueMetaBase.getBoolean() intentionally does not support TYPE_DATE: there is no defined Date→Boolean conversion, so the method throws KettleValueException 'I don't know how to convert date values to booleans.' This is a deliberate unsupported-conversion error, not a data corruption issue — the field's declared type is Date while the consumer expects a Boolean.

Solutions

  1. Convert the date explicitly to the comparison you need (e.g. valueMeta.getBoolean(convertDateToBoolean) is unavailable — instead compare dates: date != null / date.before(...))
  2. Fix the field metadata at the source so the column is TYPE_BOOLEAN (or string 'Y'/'N')
  3. Use a 'Value Mapper' or 'If field value is null'/Calculator step to derive a boolean from the date before getBoolean()

Example fix

// before
ValueMetaInterface meta = new ValueMetaBase("updated", ValueMetaInterface.TYPE_DATE);
Boolean b = meta.getBoolean(rowData); // throws
// after
ValueMetaInterface meta = new ValueMetaBase("updated", ValueMetaInterface.TYPE_DATE);
Date d = meta.getDate(rowData);
Boolean b = d != null; // explicit business rule instead of implicit coercion
Defensive patterns

Strategy: type-guard

Validate before calling

if (meta.getType() == ValueMetaInterface.TYPE_DATE) {
  // Dates cannot be coerced to booleans in Kettle; apply an explicit rule
  Date d = meta.getDate(value);
  Boolean b = (d != null) && d.before(cutoffDate);
} else {
  Boolean b = meta.getBoolean(value);
}

Type guard

boolean isBooleanReadable(ValueMetaInterface m) {
  int t = m.getType();
  return t == ValueMetaInterface.TYPE_BOOLEAN || t == ValueMetaInterface.TYPE_STRING
      || t == ValueMetaInterface.TYPE_INTEGER || t == ValueMetaInterface.TYPE_NUMBER
      || t == ValueMetaInterface.TYPE_BIGNUMBER;
}

Try / catch

try {
  Boolean b = meta.getBoolean(value);
} catch (KettleValueException e) {
  if (e.getMessage().contains("date values to booleans")) {
    Date d = meta.getDate(value); // convert via explicit business rule
    Boolean b = d != null;
  } else { throw e; }
}

Prevention

When it happens

Trigger: getBoolean(object) (or row.getBoolean / RowMeta.getBoolean on a Date-typed column) on a ValueMeta with type TYPE_DATE.

Common situations: Downstream steps or JavaScript/User Defined Java expressions assuming every field can be coerced to boolean; SQL/table input where a DATE column maps to TYPE_DATE but the transformation logic branches on it; schema drift where a column changed from boolean to date upstream.

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

Appendix: source

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

            return convertNumberToBoolean( (Double) convertBinaryStringToNativeType( (byte[]) object ) );
          case STORAGE_TYPE_INDEXED:
            return convertNumberToBoolean( (Double) index[( (Integer) object ).intValue()] );
          default:
            throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
        }
      case TYPE_BIGNUMBER:
        switch ( storageType ) {
          case STORAGE_TYPE_NORMAL:
            return convertBigNumberToBoolean( (BigDecimal) object );
          case STORAGE_TYPE_BINARY_STRING:
            return convertBigNumberToBoolean( (BigDecimal) convertBinaryStringToNativeType( (byte[]) object ) );
          case STORAGE_TYPE_INDEXED:
            return convertBigNumberToBoolean( (BigDecimal) index[( (Integer) object ).intValue()] );
          default:
            throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
        }
      case TYPE_DATE:
        throw new KettleValueException( toString() + " : I don't know how to convert date values to booleans." );
      case TYPE_BINARY:
        throw new KettleValueException( toString() + " : I don't know how to convert binary values to booleans." );
      case TYPE_SERIALIZABLE:
        throw new KettleValueException( toString() + " : I don't know how to convert serializable values to booleans." );
      default:
        throw new KettleValueException( toString() + " : Unknown type " + type + " specified." );
    }
  }

  @Override
  public Date getDate( Object object ) throws KettleValueException {
    if ( isNull( object ) ) {
      return null;
    }
    switch ( type ) {
      case TYPE_DATE:
        switch ( storageType ) {
          case STORAGE_TYPE_NORMAL:

View on GitHub (pinned to f3058517a1)