{"record":{"id":"22101590ffc38f30","repo":"pentaho/pentaho-kettle","slug":"unable-to-create-value-of-type","errorCode":null,"errorMessage":"Unable to create value of type ","messagePattern":"Unable to create value of type ","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/datagrid/DataGridMeta.java","lineNumber":379,"sourceCode":"      try {\n        if ( !Utils.isEmpty( fieldName[i] ) ) {\n          int type = ValueMetaFactory.getIdForValueMeta( fieldType[i] );\n          if ( type == ValueMetaInterface.TYPE_NONE ) {\n            type = ValueMetaInterface.TYPE_STRING;\n          }\n          ValueMetaInterface v = ValueMetaFactory.createValueMeta( fieldName[i], type );\n          v.setLength( fieldLength[i] );\n          v.setPrecision( fieldPrecision[i] );\n          v.setOrigin( name );\n          v.setConversionMask( fieldFormat[i] );\n          v.setCurrencySymbol( currency[i] );\n          v.setGroupingSymbol( group[i] );\n          v.setDecimalSymbol( decimal[i] );\n\n          rowMeta.addValueMeta( v );\n        }\n      } catch ( Exception e ) {\n        throw new KettleStepException( \"Unable to create value of type \" + fieldType[i], e );\n      }\n    }\n  }\n\n  public String getFieldNullIf( String fieldName ) throws KettleException {\n    int index;\n    boolean found = false;\n    String nullIfVal = null;\n    if ( null != fieldName ) {\n      for ( index = 0; index < this.getFieldName().length && !found; index++ ) {\n        found = fieldName.compareTo( this.getFieldName()[index] ) == 0;\n      }\n      if ( found ) {\n        nullIfVal = this.getFieldNullIf()[index - 1];\n      } else {\n        throw new KettleException( \"Unable to look up Null if value for field \" + fieldName );\n      }\n    }","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/datagrid/DataGridMeta.java#L361-L397","documentation":"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.","triggerScenarios":"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).","commonSituations":"Hand-edited .ktr files with mistyped <fieldtype> values; Data Grid metadata produced by another tool; upgraded files where a type name changed.","solutions":["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).","Re-open and re-save the step in Spoon so the type list is regenerated from the UI dropdown.","Check the chained cause for ValueMetaFactory's 'unknown type' message to identify the exact index/type.","If generated programmatically, pass ValueMetaFactory.getIdForValueMeta-safe names and validate with ValueMetaFactory before calling getFields."],"exampleFix":"// before\n<field><name>qty</name><type>strng</type></field>\n// after\n<field><name>qty</name><type>Integer</type></field>","handlingStrategy":"validation","validationCode":"for (String t : meta.getFieldType()) {\n  if (t == null || ValueMetaFactory.getIdForValueMeta(t) < 0)\n    throw new IllegalArgumentException(\"Invalid DataGrid field type: \" + t);\n}","typeGuard":"boolean isValidType(String t){\n  try { ValueMetaFactory.getIdForValueMeta(t); return true; }\n  catch (Exception e){ return false; }\n}","tryCatchPattern":"try { meta.getFields(row, origin, info, space, repository, metaStore); }\ncatch (KettleStepException e) {\n  logError(\"Bad field type: \" + e.getMessage(), e);\n}","preventionTips":["Only use type names from the Spoon dropdown (String, Integer, Number, Date, Boolean, BigNumber, Timestamp, Binary).","Validate field types programmatically with ValueMetaFactory before layout.","Re-save steps in Spoon after version upgrades.","Never hand-edit field type strings in .ktr XML."],"tags":["kettle","row-metadata","invalid-type"],"backgroundTag":"invalid-enum-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}