pentaho/pentaho-kettle · error · KettleValueException
Unknown column '
Error message
Unknown column '
What it means
getInteger(String valueName, long def) looks up the column index of valueName in the row metadata; if indexOfValue returns -1 the column does not exist and KettleValueException "Unknown column '<name>'" is thrown. The default value only applies when the stored data is null, not when the column is missing.
Solutions
- Verify the exact field name with rowMeta.indexOfValue(name) or print rowMeta.toStringMeta() before the call
- Correct the spelling/case of valueName
- Add the field via addValue(...) before reading it
- Use searchValueMeta(name) != null as a guard and fall back to the default
- Check that the repository schema/version actually contains this attribute
Example fix
// before
long id = row.getInteger("ID_TRANSFORMATION", -1); // throws if column missing
// after
long id = row.searchValueMeta("ID_TRANSFORMATION") != null
? row.getInteger("ID_TRANSFORMATION", -1) : -1; Defensive patterns
Strategy: validation
Validate before calling
if (row.getRowMeta().indexOfValue("ID_TRANSFORMATION") < 0) {
// column missing, use default
} else {
long id = row.getInteger("ID_TRANSFORMATION", -1);
} Type guard
boolean hasColumn(RowMetaAndData row, String name) {
return row != null && row.getRowMeta() != null && row.getRowMeta().indexOfValue(name) >= 0;
} Try / catch
try {
long id = row.getInteger(name, def);
} catch (KettleValueException e) {
log.logError("Column missing: " + name, e);
id = def;
} Prevention
- Always check searchValueMeta(name) != null before named getters
- Centralize field-name constants instead of inline strings
- Use the (int index, ...) variants after a verified indexOfValue
- Log rowMeta.toStringMeta() when a name lookup fails
When it happens
Trigger: Calling getInteger("fieldName", def) with a field name that was never added to the row, misspelled, or added after the row metadata was frozen.
Common situations: Typos in repository attribute names; reading an attribute that older/newer PDI versions do not write; querying a transformation/job attribute key that does not exist in the repository table.
Related errors
- Error finding ID for directory [ + repositoryDirectory + ]…
- ERROR0001
- ERROR0002
- A connection of type PALO is expected
- A connection of type PALO is expected
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/158dacc00eecb1d0.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/RowMetaAndData.java:148
public void addValue( String valueName, int valueType, Object valueData ) {
ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( valueName, valueType );
} catch ( KettlePluginException e ) {
v = new ValueMetaNone( valueName );
}
addValue( v, valueData );
}
public void clear() {
rowMeta = new RowMeta();
data = new Object[] {};
}
public long getInteger( String valueName, long def ) throws KettleValueException {
int idx = rowMeta.indexOfValue( valueName );
if ( idx < 0 ) {
throw new KettleValueException( "Unknown column '" + valueName + "'" );
}
return getInteger( idx, def );
}
public long getInteger( int index, long def ) throws KettleValueException {
Long number = rowMeta.getInteger( data, index );
if ( number == null ) {
return def;
}
return number.longValue();
}
public Long getInteger( String valueName ) throws KettleValueException {
int idx = rowMeta.indexOfValue( valueName );
if ( idx < 0 ) {
throw new KettleValueException( "Unknown column '" + valueName + "'" );
}
return rowMeta.getInteger( data, idx );View on GitHub (pinned to f3058517a1)