pentaho/pentaho-kettle · error · KettleConversionException
e.getMessage()
Error message
e.getMessage()
What it means
Thrown by SelectValues.metadataValues() when a metadata (type) change on a field fails with a KettleValueException during row conversion. The message is taken from the underlying exception (e.getMessage()) and wrapped in a KettleConversionException that also carries the offending field metadata and the row data. It means the field's value could not be converted from its current type to the target type specified in the step's Metadata tab.
Solutions
- Read the wrapped KettleConversionException message for the failing field and value
- Correct the offending row data upstream (cleanse strings, fix formats) before the Select Values step
- Adjust the conversion format/mask in the Metadata tab to match the incoming data format
- Set a default value or use 'Set to default on error' handling available in the metadata change options
- Split the conversion: convert to String first, then to the target type with proper masking
Example fix
// before: Metadata tab changes 'amount' String -> Number, data contains 'N/A' // Metadata change: amount, TYPE_NUMBER // after: cleanse upstream first // (JavaScript/UDJE step before Select Values) var amount = ( value == "N/A" || value == null ) ? "0" : value;
Defensive patterns
Strategy: validation
Validate before calling
// Pre-check that string values are convertible before the Select Values metadata change
if ( value != null && !value.matches( "-?\\d+(\\.\\d+)?" ) ) {
value = "0"; // or route the row to error handling
} Type guard
function isNumericString(v) {
return typeof v === "string" && v.trim() !== "" && !isNaN(Number(v));
} Try / catch
try {
processRow();
} catch ( KettleConversionException e ) {
logError( "Conversion failed for field " + e.getFields().get( 0 ) + ": " + e.getMessage() );
putError( ... ); // route row to error stream with the offending field
} Prevention
- Profile the incoming data (nulls, 'N/A', locale formats) before changing field types
- Set explicit conversion masks in the Metadata tab matching the data format
- Use the metadata change's default-value/error options for unconvertible values
- Cleanse and normalize data in a preceding step before type conversion
When it happens
Trigger: toMeta.convertData(fromMeta, rowData[index]) throws — e.g. converting a non-numeric string to Number, an unparseable string to Date, or an incompatible binary — inside metadataValues() called from processRow when the Metadata tab changes a field's type.
Common situations: Select Values Metadata tab changes a String field to Integer/Date while the stream contains 'N/A', empty, or locale-mismatched values; format mask in the metadata doesn't match incoming data; upstream data quality issues.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- Failed to fetch some row
- LDAPInput.Exception.CanNotReadLDAP
- TextFileInput.Log.Error.ErrorConvertingLineText
- There were " + conversionExceptions.size() + " conversion…
- AuthenticationManager.ConsumedTypeError
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/c5015958048e2017.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/selectvalues/SelectValues.java:323
// Change the data too
//
for ( int i = 0; i < data.metanrs.length; i++ ) {
int index = data.metanrs[ i ];
ValueMetaInterface fromMeta = rowMeta.getValueMeta( index );
ValueMetaInterface toMeta = data.metadataRowMeta.getValueMeta( index );
// If we need to change from BINARY_STRING storage type to NORMAL...
//
try {
if ( fromMeta.isStorageBinaryString()
&& meta.getMeta()[ i ].getStorageType() == ValueMetaInterface.STORAGE_TYPE_NORMAL ) {
rowData[ index ] = fromMeta.convertBinaryStringToNativeType( (byte[]) rowData[ index ] );
}
if ( meta.getMeta()[ i ].getType() != ValueMetaInterface.TYPE_NONE && fromMeta.getType() != toMeta.getType() ) {
rowData[ index ] = toMeta.convertData( fromMeta, rowData[ index ] );
}
} catch ( KettleValueException e ) {
throw new KettleConversionException( e.getMessage(), Collections.<Exception>singletonList( e ),
Collections.singletonList( toMeta ), rowData );
}
}
return rowData;
}
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
meta = (SelectValuesMeta) smi;
data = (SelectValuesData) sdi;
Object[] rowData = getRow(); // get row from rowset, wait for our turn, indicate busy!
if ( rowData == null ) { // no more input to be expected...
setOutputDone();
return false;
}
View on GitHub (pinned to f3058517a1)