{"record":{"id":"3b26e7c7a71317b2","repo":"pentaho/pentaho-kettle","slug":"i-don-t-know-how-to-convert-serializable-values-to-booleans","errorCode":null,"errorMessage":" : I don't know how to convert serializable values to booleans.","messagePattern":" : I don't know how to convert serializable values to booleans\\.","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":2293,"sourceCode":"            throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n        }\n      case TYPE_BIGNUMBER:\n        switch ( storageType ) {\n          case STORAGE_TYPE_NORMAL:\n            return convertBigNumberToBoolean( (BigDecimal) object );\n          case STORAGE_TYPE_BINARY_STRING:\n            return convertBigNumberToBoolean( (BigDecimal) convertBinaryStringToNativeType( (byte[]) object ) );\n          case STORAGE_TYPE_INDEXED:\n            return convertBigNumberToBoolean( (BigDecimal) index[( (Integer) object ).intValue()] );\n          default:\n            throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n        }\n      case TYPE_DATE:\n        throw new KettleValueException( toString() + \" : I don't know how to convert date values to booleans.\" );\n      case TYPE_BINARY:\n        throw new KettleValueException( toString() + \" : I don't know how to convert binary values to booleans.\" );\n      case TYPE_SERIALIZABLE:\n        throw new KettleValueException( toString() + \" : I don't know how to convert serializable values to booleans.\" );\n      default:\n        throw new KettleValueException( toString() + \" : Unknown type \" + type + \" specified.\" );\n    }\n  }\n\n  @Override\n  public Date getDate( Object object ) throws KettleValueException {\n    if ( isNull( object ) ) {\n      return null;\n    }\n    switch ( type ) {\n      case TYPE_DATE:\n        switch ( storageType ) {\n          case STORAGE_TYPE_NORMAL:\n            return (Date) object;\n          case STORAGE_TYPE_BINARY_STRING:\n            return (Date) convertBinaryStringToNativeType( (byte[]) object );\n          case STORAGE_TYPE_INDEXED:","sourceCodeStart":2275,"sourceCodeEnd":2311,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L2275-L2311","documentation":"ValueMetaBase.getBoolean(Object) throws this KettleValueException when the field type is TYPE_SERIALIZABLE. PDI does not define a conversion from an arbitrary serialized Java object to a Boolean, so it fails fast with the field metadata in the message. It signals that the field's declared type is incompatible with the requested Boolean output.","triggerScenarios":"Calling getBoolean(object) (directly or through RowMeta/getRow readers) on a ValueMeta whose type is TYPE_SERIALIZABLE, typically metadata created with new ValueMetaSerializable(...) or deserialized from a repository where the field was Serializable.","commonSituations":"Custom step/plugin code that stores objects in rows and later reads them as booleans; transformations where a Serializable field (e.g. from a user-defined Java class step) feeds a Boolean expression; ktr files carried across versions where the field type changed.","solutions":["Change the field's value type to TYPE_BOOLEAN (or another convertible type) before reading it as a Boolean.","Store/serialize an explicit Boolean (or a convertible type like String/Integer) in the field instead of an opaque Serializable object.","Catch KettleValueException and handle the Serializable field with custom conversion logic."],"exampleFix":"// before\nBoolean ok = valueMeta.getBoolean( row[i] ); // TYPE_SERIALIZABLE -> throws\n// after\nif ( valueMeta.getType() == ValueMetaInterface.TYPE_SERIALIZABLE ) {\n  Object o = row[i];\n  row[i] = o instanceof Boolean ? o : Boolean.FALSE; // put a real Boolean in a BOOLEAN-typed meta\n}\nBoolean ok = booleanMeta.getBoolean( row[i] );","handlingStrategy":"type-guard","validationCode":"if ( valueMeta.getType() == ValueMetaInterface.TYPE_SERIALIZABLE ) {\n  throw new IllegalArgumentException( \"Field \" + valueMeta.getName() + \" is SERIALIZABLE; cannot read as Boolean\" );\n}","typeGuard":"boolean readableAsBoolean( ValueMetaInterface vm ) {\n  int t = vm.getType();\n  return t == ValueMetaInterface.TYPE_BOOLEAN || t == ValueMetaInterface.TYPE_STRING\n      || t == ValueMetaInterface.TYPE_INTEGER || t == ValueMetaInterface.TYPE_NUMBER\n      || t == ValueMetaInterface.TYPE_BIGNUMBER;\n}","tryCatchPattern":"try {\n  Boolean b = valueMeta.getBoolean( row[i] );\n} catch ( KettleValueException e ) {\n  logError( \"Serializable field \" + valueMeta.getName() + \" cannot be read as boolean\" );\n}","preventionTips":["Avoid TYPE_SERIALIZABLE for values consumed as primitives; store real Booleans.","Check getType() before typed getters.","Serialize an explicit Boolean wrapper rather than opaque objects."],"tags":["kettle","value-conversion","boolean","serializable","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}