pentaho/pentaho-kettle · error · KettleValueException
: I don't know how to convert a bignumber to binary.
Error message
: I don't know how to convert a bignumber to binary.
What it means
ValueMetaBase.getBinary() has no conversion from TYPE_BIGNUMBER (BigDecimal) to binary bytes and throws KettleValueException. Only string-typed values support byte conversion in this class; arbitrary-precision numbers must be converted to strings first.
Solutions
- Convert the BigDecimal to a string via getString() and call getBinary on a TYPE_STRING meta.
- Change the field metadata to TYPE_STRING before binary output.
- Use getString() with a decimal format mask instead.
- Catch KettleValueException and handle bignumber fields explicitly.
Example fix
// before
ValueMetaInterface vm = new ValueMeta("bn", ValueMetaInterface.TYPE_BIGNUMBER);
byte[] b = vm.getBinary(bigDecimalValue); // throws
// after
String s = vm.getString(bigDecimalValue);
ValueMetaInterface vmStr = new ValueMeta("bn", ValueMetaInterface.TYPE_STRING);
byte[] b = vmStr.getBinary(s); Defensive patterns
Strategy: type-guard
Validate before calling
if (meta.getType() == ValueMetaInterface.TYPE_BIGNUMBER) { throw new IllegalArgumentException("Field " + meta.getName() + " is a bignumber; convert to String before getBinary()"); } Type guard
boolean isBinaryReadable(ValueMetaInterface vm) { return vm.getType() == ValueMetaInterface.TYPE_STRING || vm.getType() == ValueMetaInterface.TYPE_BINARY; } Try / catch
try { byte[] b = vm.getBinary(value); } catch (KettleValueException e) { byte[] b = vm.getString(value).getBytes(StandardCharsets.UTF_8); } Prevention
- Convert BigDecimal fields to strings before byte output.
- Gate getBinary() on the declared value type.
- Use format masks via getString() for decimal formatting.
- Audit generic serializers to reject unsupported types up front.
When it happens
Trigger: Calling getBinary(object) on a value meta whose type is ValueMetaInterface.TYPE_BIGNUMBER.
Common situations: Binary output of decimal/precision-critical fields; generic serialization code iterating row fields; output plugins expecting bytes for every type.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- : I don't know how to convert a binary value to date.
- : I don't know how to convert a boolean to binary.
- : I don't know how to convert a number to binary.
- : I don't know how to convert an integer to binary.
- BaseStep.SafeMode.Exception.MixingTypes
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/77e3721e9a268231.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java:2407
case TYPE_DATE:
throw new KettleValueException( toString() + " : I don't know how to convert a date to binary." );
case TYPE_STRING:
switch ( storageType ) {
case STORAGE_TYPE_NORMAL:
return convertStringToBinaryString( (String) object );
case STORAGE_TYPE_BINARY_STRING:
return (byte[]) object;
case STORAGE_TYPE_INDEXED:
return convertStringToBinaryString( (String) index[( (Integer) object ).intValue()] );
default:
throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
}
case TYPE_NUMBER:
throw new KettleValueException( toString() + " : I don't know how to convert a number to binary." );
case TYPE_INTEGER:
throw new KettleValueException( toString() + " : I don't know how to convert an integer to binary." );
case TYPE_BIGNUMBER:
throw new KettleValueException( toString() + " : I don't know how to convert a bignumber to binary." );
case TYPE_BOOLEAN:
throw new KettleValueException( toString() + " : I don't know how to convert a boolean to binary." );
case TYPE_SERIALIZABLE:
throw new KettleValueException( toString() + " : I don't know how to convert a serializable to binary." );
default:
throw new KettleValueException( toString() + " : Unknown type " + type + " specified." );
}
}
@Override
public byte[] getBinaryString( Object object ) throws KettleValueException {
// If the input is a binary string, we should return the exact same binary
// object IF
// and only IF the formatting options for the storage metadata and this
// object are the same.
//
if ( isStorageBinaryString() && identicalFormat ) {View on GitHub (pinned to f3058517a1)