pentaho/pentaho-kettle · error · KettleValueException

Unknown conversion from

Error message

Unknown conversion from <typeDesc> into <destinationType>

What it means

Thrown at the end of getAsJavaType() when the source field's ValueMetaInterface type is not one of the handled types in the switch (String, Boolean, Integer, Number). Unlike the per-case RuntimeExceptions (errors 111/113-115), this is a KettleValueException reporting both the source type description and the requested destination type.

Solutions

  1. Convert the source field to a supported type (String, Integer, Number, Boolean) before injection, e.g. via a Select Values or Calculator step
  2. Pre-format Date/Timestamp fields as strings and inject as TYPE_STRING
  3. Catch KettleValueException and validate field types against the supported set before injecting
  4. Upgrade Kettle/Pentaho if a newer version added support for the type

Example fix

// before
row.getAsJavaType("created_at", String.class, converter); // Date field
// after
rowMeta.setValueMeta(idx, new ValueMetaString("created_at")); // convert first
row.getAsJavaType("created_at", String.class, converter);
Defensive patterns

Strategy: validation

Validate before calling

int idx = row.getRowMeta().indexOfValue(name);
int t = row.getRowMeta().getValueMeta(idx).getType();
if (t != ValueMetaInterface.TYPE_STRING && t != ValueMetaInterface.TYPE_INTEGER
  && t != ValueMetaInterface.TYPE_NUMBER && t != ValueMetaInterface.TYPE_BOOLEAN) {
  throw new IllegalArgumentException("Unsupported source type " + row.getRowMeta().getValueMeta(idx).getTypeDesc()
    + " for injection field " + name);
}

Type guard

boolean isInjectionSourceSupported(ValueMetaInterface vm) {
  int t = vm.getType();
  return t == ValueMetaInterface.TYPE_STRING || t == ValueMetaInterface.TYPE_INTEGER
    || t == ValueMetaInterface.TYPE_NUMBER || t == ValueMetaInterface.TYPE_BOOLEAN;
}

Try / catch

try {
  Object v = row.getAsJavaType(name, destType, converter);
} catch (KettleValueException e) {
  if (e.getMessage().startsWith("Unknown conversion from")) {
    log.error("Unsupported source field type for injection: " + e.getMessage(), e);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling setProperty/getAsJavaType where the row field's meta type is, e.g., TYPE_DATE, TYPE_TIMESTAMP, TYPE_BINARY, or TYPE_BIGNUMBER — types not handled by the switch — regardless of destinationType.

Common situations: Metadata injection sourced from Date or Timestamp fields (e.g. from a Table Input or Get System Info step); binary/large-object fields feeding the injector.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/RowMetaAndData.java:422

          return converter.number2intPrimitive( vn );
        } else if ( Integer.class.isAssignableFrom( destinationType ) ) {
          return converter.number2integer( vn );
        } else if ( long.class.isAssignableFrom( destinationType ) ) {
          return converter.number2longPrimitive( vn );
        } else if ( Long.class.isAssignableFrom( destinationType ) ) {
          return converter.number2long( vn );
        } else if ( boolean.class.isAssignableFrom( destinationType ) ) {
          return converter.number2booleanPrimitive( vn );
        } else if ( Boolean.class.isAssignableFrom( destinationType ) ) {
          return converter.number2boolean( vn );
        } else if ( destinationType.isEnum() ) {
          return converter.number2enum( destinationType, vn );
        } else {
          throw new RuntimeException( "Wrong value conversion to " + destinationType );
        }
    }

    throw new KettleValueException( "Unknown conversion from " + metaType.getTypeDesc() + " into " + destinationType );
  }

  public void removeValue( String valueName ) throws KettleValueException {
    int index = rowMeta.indexOfValue( valueName );
    if ( index < 0 ) {
      throw new KettleValueException( "Unable to find '" + valueName + "' in the row" );
    }
    removeValue( index );
  }

  public void removeValue( int index ) {
    rowMeta.removeValueMeta( index );
    data = RowDataUtil.removeItem( data, index );
  }

  public void mergeRowMetaAndData( RowMetaAndData rowMetaAndData, String originStepName ) {
    int originalMetaSize = rowMeta.size();
    rowMeta.mergeRowMeta( rowMetaAndData.getRowMeta(), originStepName );

View on GitHub (pinned to f3058517a1)