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

  1. Verify the exact field name with rowMeta.indexOfValue(name) or print rowMeta.toStringMeta() before the call
  2. Correct the spelling/case of valueName
  3. Add the field via addValue(...) before reading it
  4. Use searchValueMeta(name) != null as a guard and fall back to the default
  5. 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

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


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)