{"record":{"id":"9d3fc6fd2e909f67","repo":"pentaho/pentaho-kettle","slug":"unknown-type-type-specified-valuemetatimestamp","errorCode":null,"errorMessage":" : Unknown type \" + type + \" specified.","messagePattern":" : Unknown type \" \\+ type \\+ \" specified\\.","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java","lineNumber":194,"sourceCode":"          case STORAGE_TYPE_NORMAL:\n            return convertBigNumberToTimestamp( (BigDecimal) object );\n          case STORAGE_TYPE_BINARY_STRING:\n            return convertBigNumberToTimestamp( (BigDecimal) convertBinaryStringToNativeType( (byte[]) object ) );\n          case STORAGE_TYPE_INDEXED:\n            return convertBigNumberToTimestamp( (BigDecimal) index[ ( (Integer) object ).intValue() ] );\n          default:\n            throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n        }\n      case TYPE_BOOLEAN:\n        throw new KettleValueException( toString() + \" : I don't know how to convert a boolean to a timestamp.\" );\n      case TYPE_BINARY:\n        throw new KettleValueException( toString() + \" : I don't know how to convert a binary value to timestamp.\" );\n      case TYPE_SERIALIZABLE:\n        throw new KettleValueException( toString()\n          + \" : I don't know how to convert a serializable value to timestamp.\" );\n\n      default:\n        throw new KettleValueException( toString() + \" : Unknown type \" + type + \" specified.\" );\n    }\n  }\n\n  public int compare( Object data1, Object data2 ) throws KettleValueException {\n    Timestamp timestamp1 = getTimestamp( data1 );\n    Timestamp timestamp2 = getTimestamp( data2 );\n    int cmp = 0;\n    if ( timestamp1 == null ) {\n      if ( timestamp2 == null ) {\n        cmp = 0;\n      } else {\n        cmp = -1;\n      }\n    } else if ( timestamp2 == null ) {\n      cmp = 1;\n    } else {\n      cmp = timestamp1.compareTo( timestamp2 );\n    }","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaTimestamp.java#L176-L212","documentation":"The final default branch of getTimestamp() throws this KettleValueException when the field's declared type constant matches none of the handled cases (TYPE_DATE/TIMESTAMP, TYPE_STRING, TYPE_NUMBER, TYPE_INTEGER, TYPE_BIGNUMBER, TYPE_BOOLEAN, TYPE_BINARY, TYPE_SERIALIZABLE). It means the metadata's type code is unknown or corrupted relative to the ValueMeta types this class recognizes.","triggerScenarios":"getTimestamp(object) called with a value meta whose getType() returns an out-of-range or unrecognized type constant (e.g. a type code from a newer PDI version read by an older core, or a hand-set bogus value via setType(int)).","commonSituations":"Mixing PDI plugin/core versions where type constants diverged; metadata deserialized from an incompatible KTR; programmatic bugs writing arbitrary ints into the type field.","solutions":["Print valueMeta.getType() and compare against ValueMetaInterface.TYPE_* constants; set a valid type with meta.setType(...) before conversion.","Upgrade/align the PDI core and plugin versions so type constants match the serialization format of your transformations.","Re-save the transformation with the current PDI version to normalize type codes.","If the value actually is a timestamp, use TYPE_TIMESTAMP (or TYPE_DATE) metadata so the direct (Timestamp) object path is taken."],"exampleFix":"// before\nValueMeta meta = new ValueMeta();\nmeta.setType( 999 ); // unknown type\nTimestamp t = meta.getTimestamp( obj ); // throws Unknown type\n// after\nValueMeta meta = new ValueMeta();\nmeta.setType( ValueMetaInterface.TYPE_TIMESTAMP );\nTimestamp t = meta.getTimestamp( obj );","handlingStrategy":"validation","validationCode":"int type = meta.getType();\nif ( type < ValueMetaInterface.TYPE_NONE || type > ValueMetaInterface.TYPE_SERIALIZABLE ) {\n  meta.setType( ValueMetaInterface.TYPE_TIMESTAMP );\n}","typeGuard":"boolean hasKnownType( ValueMetaInterface meta ) {\n  switch ( meta.getType() ) {\n    case ValueMetaInterface.TYPE_TIMESTAMP:\n    case ValueMetaInterface.TYPE_DATE:\n    case ValueMetaInterface.TYPE_STRING:\n    case ValueMetaInterface.TYPE_NUMBER:\n    case ValueMetaInterface.TYPE_INTEGER:\n    case ValueMetaInterface.TYPE_BIGNUMBER:\n    case ValueMetaInterface.TYPE_BOOLEAN:\n    case ValueMetaInterface.TYPE_BINARY:\n    case ValueMetaInterface.TYPE_SERIALIZABLE:\n      return true;\n    default:\n      return false;\n  }\n}","tryCatchPattern":"try {\n  t = meta.getTimestamp( value );\n} catch ( KettleValueException e ) {\n  if ( e.getMessage().contains( \"Unknown type\" ) ) {\n    meta.setType( ValueMetaInterface.TYPE_TIMESTAMP );\n    t = meta.getTimestamp( value );\n  } else { throw e; }\n}","preventionTips":["Never pass raw ints to setType(); use ValueMetaInterface.TYPE_* constants.","Align PDI core and plugin versions so type constants and serialized metadata match.","Re-save transformations from older versions with the current PDI release.","Validate getType() against known constants before any conversion call."],"tags":["kettle","pdi","unknown-type","timestamp","invalid-enum"],"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"}