{"record":{"id":"983d53dd4b4c747b","repo":"pentaho/pentaho-kettle","slug":"unknown-data-type-type","errorCode":null,"errorMessage":"Unknown data type : type","messagePattern":"Unknown data type : type","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java","lineNumber":393,"sourceCode":"      return null;\n    }\n    String valueString = value.substring( 2 );\n    char type = value.charAt( 0 );\n    switch ( type ) {\n      case 'S':\n        return valueString;\n      case 'T':\n        return new SimpleTimestampFormat( ValueMetaBase.DEFAULT_TIMESTAMP_FORMAT_MASK ).parse( valueString );\n      case 'D':\n        return new SimpleDateFormat( ValueMetaBase.DEFAULT_DATE_FORMAT_MASK ).parse( valueString );\n      case 'N':\n        return Double.valueOf( valueString );\n      case 'I':\n        return Long.valueOf( valueString );\n      case 'B':\n        return \"true\".equalsIgnoreCase( valueString ) || \"y\".equalsIgnoreCase( valueString );\n      default:\n        throw new KettleException( \"Unknown data type : \" + type );\n    }\n  }\n\n  public String encodeAttributeValue( Object object ) throws Exception {\n    if ( object == null ) {\n      return \"\";\n    }\n    if ( object instanceof String ) {\n      return \"S:\" + object.toString();\n    }\n    if ( object instanceof Timestamp ) {\n      return \"T:\" + new SimpleTimestampFormat(\n        ValueMetaBase.DEFAULT_TIMESTAMP_FORMAT_MASK ).format( (Timestamp) object );\n    }\n    if ( object instanceof Date ) {\n      return \"D:\" + new SimpleDateFormat( ValueMetaBase.DEFAULT_DATE_FORMAT_MASK ).format( (Date) object );\n    }\n    if ( object instanceof Double ) {","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryMetaStoreDelegate.java#L375-L411","documentation":"parseAttributeValue found a type prefix letter it does not support (expected S=String, D=Double, I=Long, B=Boolean) and throws KettleException \"Unknown data type\". The encoded attribute value was written with an unknown or corrupt type letter.","triggerScenarios":"Reading a metastore attribute whose value string's first char is not one of S/D/I/B — e.g. empty value, manually edited row, or value written by a newer/older metastore encoder.","commonSituations":"Manual SQL edits to R_ELEMENT_ATTRIBUTE; empty value string missing its type prefix; version drift between PDI instances sharing one repository.","solutions":["Fix or delete the offending R_ELEMENT_ATTRIBUTE row so the value starts with a supported type letter (S:/D:/I:/B:)","Re-save the element via the metastore API to re-encode values","Ensure all PDI nodes sharing the repository run compatible versions","Pre-validate encoded values (empty or missing prefix) before parsing"],"exampleFix":"// before: trusting value\nObject v = delegate.parseAttributeValue(\"42\");\n// after: guard the prefix\nString value = \"I:42\";\nif (value == null || value.isEmpty() || !\"SDIB\".contains(value.substring(0, 1))) {\n  throw new IllegalArgumentException(\"Attribute value lacks valid type prefix: \" + value);\n}\nObject v = delegate.parseAttributeValue(value);","handlingStrategy":"validation","validationCode":"boolean hasKnownTypePrefix(String encoded) { return encoded != null && !encoded.isEmpty() && \"SDIB\".indexOf(encoded.charAt(0)) >= 0; }","typeGuard":"boolean isDecodableValue(String v) { return v != null && v.length() >= 2 && \"SDIB\".contains(v.substring(0,1)); }","tryCatchPattern":"try { Object v = delegate.parseAttributeValue(value); } catch (KettleException e) { v = defaultValue; logWarn(\"Unknown metastore value type: \" + value, e); }","preventionTips":["Always write attribute values through the metastore API","Ensure all PDI nodes sharing the repository use the same version","Reject values without a valid S/D/I/B prefix at ingest"],"tags":["metastore","encoding","data-type","parse"],"backgroundTag":"invalid-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"}