{"record":{"id":"7bfe7ff4afd728de","repo":"pentaho/pentaho-kettle","slug":"please-set-a-value-for-the-missing-field-s-type","errorCode":null,"errorMessage":"Please set a value for the missing field(s) type.","messagePattern":"Please set a value for the missing field\\(s\\) type\\.","errorType":"validation","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java","lineNumber":1257,"sourceCode":"  /**\n   * putRow is used to copy a row, to the alternate rowset(s) This should get priority over everything else!\n   * (synchronized) If distribute is true, a row is copied only once to the output rowsets, otherwise copies are sent to\n   * each rowset!\n   *\n   * @param row The row to put to the destination rowset(s).\n   * @throws KettleStepException\n   */\n  @Override\n  public void putRow( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException {\n    if ( rowMeta != null ) {\n      if ( !allowEmptyFieldNamesAndTypes ) {\n        // check row meta for empty field name (BACKLOG-18004)\n        for ( ValueMetaInterface vmi : rowMeta.getValueMetaList() ) {\n          if ( StringUtils.isBlank( vmi.getName() ) ) {\n            throw new KettleStepException( \"Please set a field name for all field(s) that have 'null'.\" );\n          }\n          if ( vmi.getType() <= 0 ) {\n            throw new KettleStepException( \"Please set a value for the missing field(s) type.\" );\n          }\n        }\n      }\n    }\n    getRowHandler().putRow( rowMeta, row );\n  }\n\n  private void handlePutRow( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException {\n    // Are we pausing the step? If so, stall forever...\n    //\n    while ( paused.get() && !stopped.get() ) {\n      try {\n        Thread.sleep( 1 );\n      } catch ( InterruptedException e ) {\n        throw new KettleStepException( e );\n      }\n    }\n","sourceCodeStart":1239,"sourceCodeEnd":1275,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java#L1239-L1275","documentation":"In the same putRow() validation loop, a ValueMetaInterface whose getType() <= 0 (undefined/missing type) causes KettleStepException 'Please set a value for the missing field(s) type.' Each outgoing field must have a concrete Kettle data type.","triggerScenarios":"putRow() called with a row meta containing a value meta constructed without a type (type 0 / TYPE_NONE), e.g. new ValueMetaBase(\"field\") with no type assigned, or metadata copied from an undefined source column.","commonSituations":"Scripting/UDJC steps that create ValueMeta objects but never set the type; 'unspecified' columns passed through from Get Files / Excel stages; merge-join producing fields of unknown type.","solutions":["Assign a concrete type, e.g. vmi.setValueType(ValueMetaInterface.TYPE_STRING), before putRow.","Construct value metas with an explicit type: new ValueMetaString(\"field\") instead of a typeless base.","Set allowEmptyFieldNamesAndTypes(true) only if untyped fields must be tolerated.","Use a 'Select Values'/metadata step upstream to force types on unspecified fields."],"exampleFix":"// before\nValueMetaInterface vmi = new ValueMetaBase(\"field\"); // type 0\n// after\nValueMetaInterface vmi = new ValueMetaString(\"field\");","handlingStrategy":"validation","validationCode":"for (ValueMetaInterface vmi : rowMeta.getValueMetaList()) {\n  if (vmi.getType() <= 0) vmi.setValueType(ValueMetaInterface.TYPE_STRING); // or throw\n}","typeGuard":null,"tryCatchPattern":"try { putRow(rowMeta, row); }\ncatch (KettleStepException e) { if (e.getMessage().contains(\"missing field(s) type\")) { forceTypes(rowMeta); putRow(rowMeta, row); } else throw e; }","preventionTips":["Use typed constructors (ValueMetaString, ValueMetaNumber)","Force types with a Select Values metadata step upstream","Never emit TYPE_NONE columns from scripts"],"tags":["kettle","row-metadata","value-type","validation"],"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"}