pentaho/pentaho-kettle · error · KettleFileException
: Unable to serialize indexe storage type for data type
Error message
: Unable to serialize indexe storage type for data type
What it means
KettleFileException thrown by ValueMetaBase.writeData for STORAGE_TYPE_INDEXED values when an individual index entry's type is not serializable by the writer's inner switch (unsupported for String, Number, Integer, Date, Boolean, Binary, BigNumber, etc.). It indicates an index table containing values of a data type the binary writer cannot serialize.
Solutions
- Ensure every element in the index array is of a type supported by writeData (String, Long/Integer, Double, Date, Boolean, byte[], BigDecimal, InetAddress)
- Convert unsupported index entries to supported types when building the indexed value meta
- Fall back to STORAGE_TYPE_NORMAL for values whose types the indexed writer cannot handle
Example fix
// before
index[i] = new Timestamp(...); // not matched by writer switch
// after
if (index[i] instanceof Timestamp) {
index[i] = new Date(((Timestamp) index[i]).getTime());
} Defensive patterns
Strategy: validation
Validate before calling
// Validate every index entry before assigning an indexed storage type:
static void validateIndexedEntries(ValueMetaInterface vmi, Object[] index) throws KettleFileException {
for (int i = 0; i < index.length; i++) {
Object o = index[i];
if (o == null) continue;
Class<?> expected = expectedClassFor(vmi.getType());
if (!expected.isInstance(o)) {
throw new KettleFileException("Index entry " + i + " expects " + expected.getName()
+ " but is " + o.getClass().getName());
}
}
} Try / catch
try {
valueMeta.writeData(out, object);
} catch (KettleFileException e) {
if (String.valueOf(e.getMessage()).contains("Unable to serialize indexe")) {
LOG.error("Indexed field " + valueMeta.getName() + " has an unsupported entry type");
// convert entries to supported classes or switch storage type and retry
} else { throw e; }
} Prevention
- Build index arrays only with the exact classes the value meta's type maps to
- Convert Timestamp to Date, Integer to Long, etc., when populating lookup tables
- Prefer STORAGE_TYPE_NORMAL unless the indexed-encoding performance benefit is measured and needed
- Unit-test writeData/readData round-trips for indexed value metas
When it happens
Trigger: writeData() on an indexed ValueMeta whose index array holds, e.g., java.util.Date subclasses, BigDecimal beyond supported cases, or arbitrary objects; the inner default branch throws for that element's type.
Common situations: Building indexed storage types from lookup tables containing unsupported classes; metadata generated by custom code or plugins with mixed-type index arrays.
Related errors
- : There was a data type error: the data type of object []…
- : Unable to serialize data type " + getType()
- CubeInputMeta.Exception.UnableToLoadStepInfo
- Error loading transformation step from XML
- Error loading transformation step from XML
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/6abe96d9ee54f27d.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java:3013
writeNumber( outputStream, (Double) index[i] );
break;
case TYPE_INTEGER:
writeInteger( outputStream, (Long) index[i] );
break;
case TYPE_DATE:
writeDate( outputStream, (Date) index[i] );
break;
case TYPE_BIGNUMBER:
writeBigNumber( outputStream, (BigDecimal) index[i] );
break;
case TYPE_BOOLEAN:
writeBoolean( outputStream, (Boolean) index[i] );
break;
case TYPE_BINARY:
writeBinary( outputStream, (byte[]) index[i] );
break;
default:
throw new KettleFileException( toString()
+ " : Unable to serialize indexe storage type for data type " + getType() );
}
} catch ( ClassCastException e ) {
throw new RuntimeException( toString() + " : There was a data type error: the data type of "
+ index[i].getClass().getName() + " object [" + index[i] + "] does not correspond to value meta ["
+ toStringMeta() + "]" );
}
}
}
break;
case STORAGE_TYPE_BINARY_STRING:
// Save the storage meta data...
//
outputStream.writeBoolean( storageMetadata != null );
if ( storageMetadata != null ) {
storageMetadata.writeMeta( outputStream );View on GitHub (pinned to f3058517a1)