{"record":{"id":"8f8ae6aca02b7073","repo":"pentaho/pentaho-kettle","slug":"unable-to-serialize-data-type-gettype","errorCode":null,"errorMessage":" : Unable to serialize data type \" + getType()","messagePattern":" : Unable to serialize data type \" \\+ getType\\(\\)","errorType":"exception","errorClass":"KettleFileException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":2761,"sourceCode":"                writeInteger( outputStream, (Long) object );\n                break;\n              case TYPE_DATE:\n                writeDate( outputStream, (Date) object );\n                break;\n              case TYPE_BIGNUMBER:\n                writeBigNumber( outputStream, (BigDecimal) object );\n                break;\n              case TYPE_BOOLEAN:\n                writeBoolean( outputStream, (Boolean) object );\n                break;\n              case TYPE_BINARY:\n                writeBinary( outputStream, (byte[]) object );\n                break;\n              case TYPE_INET:\n                writeBinary( outputStream, ( (InetAddress) object ).getAddress() );\n                break;\n              default:\n                throw new KettleFileException( toString() + \" : Unable to serialize data type \" + getType() );\n            }\n            break;\n\n          case STORAGE_TYPE_BINARY_STRING:\n            // Handle binary string content -- only when not NULL\n            // In this case, we opt not to convert anything at all for speed.\n            // That way, we can save on CPU power.\n            // Since the streams can be compressed, volume shouldn't be an issue\n            // at all.\n            //\n            writeBinaryString( outputStream, (byte[]) object );\n            break;\n\n          case STORAGE_TYPE_INDEXED:\n            writeInteger( outputStream, (Integer) object ); // just an index\n            break;\n\n          default:","sourceCodeStart":2743,"sourceCodeEnd":2779,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L2743-L2779","documentation":"KettleFileException thrown by ValueMetaBase.writeData when the value's storage type is STORAGE_TYPE_NORMAL but getType() does not match any of the cases handled by the serialization switch (String, Number, Integer, Date, Boolean, Binary, Big Number, InetAddress, etc.). It means the value data type is unknown to the binary serialization writer.","triggerScenarios":"Calling writeData() on a ValueMeta whose type is a valid internal type like TYPE_SERIALIZABLE, TYPE_TIMESTAMP (on older versions), or a custom/unknown type not covered by the writer's switch default branch.","commonSituations":"Clustering or streaming rows containing Serializable/Java-object fields over Kettle's binary protocol; using a value type added in a newer Pentaho version against an older writer; corrupt metadata where type constants were set programmatically to out-of-range values.","solutions":["Avoid serializing rows with TYPE_SERIALIZABLE fields using writeData; store such data differently or convert to a supported type","Upgrade all nodes in the cluster to the same Pentaho/Kettle version so type constants match","Validate getType() before serialization and convert unsupported types to supported ones (e.g., TIMESTAMP to Date if on an older version)"],"exampleFix":"// before\nvalueMeta.writeData(outputStream, object); // valueMeta type is TYPE_SERIALIZABLE\n// after\nif (valueMeta.getType() == ValueMetaInterface.TYPE_SERIALIZABLE) {\n  valueMeta = valueMeta.clone(); valueMeta.setType(ValueMetaInterface.TYPE_STRING);\n}\nvalueMeta.writeData(outputStream, object);","handlingStrategy":"validation","validationCode":"// Before serializing a row over Kettle's binary protocol:\nstatic void assertWritableType(ValueMetaInterface vmi) throws KettleFileException {\n  switch (vmi.getType()) {\n    case ValueMetaInterface.TYPE_STRING:\n    case ValueMetaInterface.TYPE_NUMBER:\n    case ValueMetaInterface.TYPE_INTEGER:\n    case ValueMetaInterface.TYPE_DATE:\n    case ValueMetaInterface.TYPE_BOOLEAN:\n    case ValueMetaInterface.TYPE_BIGNUMBER:\n    case ValueMetaInterface.TYPE_BINARY:\n    case ValueMetaInterface.TYPE_INET:\n      return; // supported by writeData\n    default:\n      throw new KettleFileException(\"Type \" + vmi.getType() + \" on '\" + vmi.getName() + \"' is not serializable by writeData\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  valueMeta.writeData(out, object);\n} catch (KettleFileException e) {\n  if (String.valueOf(e.getMessage()).contains(\"Unable to serialize data type\")) {\n    // convert field to a supported type or drop it before retry\n  } else { throw e; }\n}","preventionTips":["Avoid TYPE_SERIALIZABLE fields in rows streamed between cluster nodes","Pin identical Kettle/Pentaho versions across all nodes sharing serialized rows","Map new types (e.g., TIMESTAMP) to supported ones when targeting older versions","Unit-test row serialization round-trips (writeData + readData) in CI for your row layouts"],"tags":["kettle","pdi","serialization","unsupported-type","binary-protocol"],"backgroundTag":"unsupported-enum-value","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"}