{"record":{"id":"6df96d3668b7aa64","repo":"pentaho/pentaho-kettle","slug":"i-don-t-know-how-to-convert-serializable-values-to","errorCode":null,"errorMessage":" : I don't know how to convert serializable values to BigDecimals.","messagePattern":" : I don't know how to convert serializable values to BigDecimals\\.","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":2217,"sourceCode":"              return convertDateToBigNumber( (Date) index[( (Integer) object ).intValue()] );\n            default:\n              throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n          }\n        case TYPE_BOOLEAN:\n          switch ( storageType ) {\n            case STORAGE_TYPE_NORMAL:\n              return convertBooleanToBigNumber( (Boolean) object );\n            case STORAGE_TYPE_BINARY_STRING:\n              return convertBooleanToBigNumber( (Boolean) convertBinaryStringToNativeType( (byte[]) object ) );\n            case STORAGE_TYPE_INDEXED:\n              return convertBooleanToBigNumber( (Boolean) index[( (Integer) object ).intValue()] );\n            default:\n              throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n          }\n        case TYPE_BINARY:\n          throw new KettleValueException( toString() + \" : I don't know how to convert binary values to BigDecimals.\" );\n        case TYPE_SERIALIZABLE:\n          throw new KettleValueException( toString() + \" : I don't know how to convert serializable values to BigDecimals.\" );\n        default:\n          throw new KettleValueException( toString() + \" : Unknown type \" + type + \" specified.\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleValueException( \"Unexpected conversion error while converting value [\" + toString()\n          + \"] to a BigNumber\", e );\n    }\n  }\n\n  @Override\n  public Boolean getBoolean( Object object ) throws KettleValueException {\n    if ( object == null ) {\n      return null;\n    }\n    switch ( type ) {\n      case TYPE_BOOLEAN:\n        switch ( storageType ) {\n          case STORAGE_TYPE_NORMAL:","sourceCodeStart":2199,"sourceCodeEnd":2235,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L2199-L2235","documentation":"ValueMetaBase.getBigNumber() cannot convert TYPE_SERIALIZABLE values (arbitrary Java objects stored in a row) to BigDecimal. Because no meaningful numeric interpretation exists, it throws KettleValueException. The field's declared type does not match what the consuming code expects.","triggerScenarios":"Calling getBigNumber(object) on a ValueMeta with type TYPE_SERIALIZABLE — typically data produced by custom steps, Kettle streaming serialization, or objects passed through via Serializable storage.","commonSituations":"Custom plugin steps stash POJOs in rows; after a refactor or plugin version change a previously numeric field comes back as Serializable; generic row-copying logic assumes all values are numeric.","solutions":["Change the field metadata to a numeric type (TYPE_BIGNUMBER/TYPE_NUMBER/TYPE_INTEGER) at the producing step","Unwrap/convert the Serializable object yourself to BigDecimal before calling getBigNumber","Add an upfront type check with getValueMeta().getType() != TYPE_SERIALIZABLE before numeric access"],"exampleFix":"// before\nObject raw = row[i]; // serializable POJO holding a numeric\nBigDecimal v = valueMeta.getBigNumber(raw); // throws\n// after\nObject raw = row[i];\nBigDecimal v = raw instanceof BigDecimal ? (BigDecimal) raw : new BigDecimal(String.valueOf(extractNumber(raw)));","handlingStrategy":"validation","validationCode":"if (meta.getType() == ValueMetaInterface.TYPE_SERIALIZABLE) {\n  throw new IllegalArgumentException(\"Field '\" + meta.getName() + \"' is SERIALIZABLE; convert to BigDecimal explicitly first\");\n}\nBigDecimal v = meta.getBigNumber(value);","typeGuard":"boolean isSerializable(ValueMetaInterface m) {\n  return m.getType() == ValueMetaInterface.TYPE_SERIALIZABLE;\n}","tryCatchPattern":"try {\n  BigDecimal v = meta.getBigNumber(value);\n} catch (KettleValueException e) {\n  Object raw = value;\n  BigDecimal v = extractBigDecimal(raw); // custom unwrap for POJOs\n}","preventionTips":["Avoid stashing POJOs in rows that later flow through generic numeric logic","Document field types in step metadata so consumers know what to expect","Retype fields explicitly (Select Values / Metadata step) before numeric consumption"],"tags":["kettle","pdi","type-conversion","value-metadata"],"backgroundTag":"incompatible-source-type","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"}