pentaho/pentaho-kettle · error · KettleStepException

Unable to create value of type

Error message

Unable to create value of type 

What it means

DataGridMeta.getFields builds the output row layout from the grid's field definitions, converting each declared fieldType string to a ValueMeta via ValueMetaFactory. If a type string is not a recognized Kettle value type (or is null), the conversion throws and is wrapped in this KettleStepException naming the offending type.

Solutions

  1. Fix the fieldType value for the offending field in the Data Grid step to a valid Kettle type (String, Integer, Number, Date, Boolean, BigNumber, Timestamp, Binary).
  2. Re-open and re-save the step in Spoon so the type list is regenerated from the UI dropdown.
  3. Check the chained cause for ValueMetaFactory's 'unknown type' message to identify the exact index/type.
  4. If generated programmatically, pass ValueMetaFactory.getIdForValueMeta-safe names and validate with ValueMetaFactory before calling getFields.

Example fix

// before
<field><name>qty</name><type>strng</type></field>
// after
<field><name>qty</name><type>Integer</type></field>
Defensive patterns

Strategy: validation

Validate before calling

for (String t : meta.getFieldType()) {
  if (t == null || ValueMetaFactory.getIdForValueMeta(t) < 0)
    throw new IllegalArgumentException("Invalid DataGrid field type: " + t);
}

Type guard

boolean isValidType(String t){
  try { ValueMetaFactory.getIdForValueMeta(t); return true; }
  catch (Exception e){ return false; }
}

Try / catch

try { meta.getFields(row, origin, info, space, repository, metaStore); }
catch (KettleStepException e) {
  logError("Bad field type: " + e.getMessage(), e);
}

Prevention

When it happens

Trigger: getFields is called during transformation layout calculation and fieldType[i] contains an invalid, empty, or null type string (e.g. 'strng' instead of 'String', or a type dropped by a version change).

Common situations: Hand-edited .ktr files with mistyped <fieldtype> values; Data Grid metadata produced by another tool; upgraded files where a type name changed.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/22101590ffc38f30. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/datagrid/DataGridMeta.java:379

      try {
        if ( !Utils.isEmpty( fieldName[i] ) ) {
          int type = ValueMetaFactory.getIdForValueMeta( fieldType[i] );
          if ( type == ValueMetaInterface.TYPE_NONE ) {
            type = ValueMetaInterface.TYPE_STRING;
          }
          ValueMetaInterface v = ValueMetaFactory.createValueMeta( fieldName[i], type );
          v.setLength( fieldLength[i] );
          v.setPrecision( fieldPrecision[i] );
          v.setOrigin( name );
          v.setConversionMask( fieldFormat[i] );
          v.setCurrencySymbol( currency[i] );
          v.setGroupingSymbol( group[i] );
          v.setDecimalSymbol( decimal[i] );

          rowMeta.addValueMeta( v );
        }
      } catch ( Exception e ) {
        throw new KettleStepException( "Unable to create value of type " + fieldType[i], e );
      }
    }
  }

  public String getFieldNullIf( String fieldName ) throws KettleException {
    int index;
    boolean found = false;
    String nullIfVal = null;
    if ( null != fieldName ) {
      for ( index = 0; index < this.getFieldName().length && !found; index++ ) {
        found = fieldName.compareTo( this.getFieldName()[index] ) == 0;
      }
      if ( found ) {
        nullIfVal = this.getFieldNullIf()[index - 1];
      } else {
        throw new KettleException( "Unable to look up Null if value for field " + fieldName );
      }
    }

View on GitHub (pinned to f3058517a1)