{"record":{"id":"154ad75ccf77f581","repo":"pentaho/pentaho-kettle","slug":"please-set-a-field-name-for-all-field-s-that-have-null","errorCode":null,"errorMessage":"Please set a field name for all field(s) that have 'null'.","messagePattern":"Please set a field name for all field\\(s\\) that have 'null'\\.","errorType":"validation","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java","lineNumber":1254,"sourceCode":"  }\n\n\n  /**\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 );","sourceCodeStart":1236,"sourceCodeEnd":1272,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java#L1236-L1272","documentation":"BaseStep.putRow() validates outgoing row metadata unless allowEmptyFieldNamesAndTypes is set: if any ValueMetaInterface has a blank name, it throws KettleStepException 'Please set a field name for all field(s) that have null.' This guards downstream steps and serialization from anonymous fields (BACKLOG-18004).","triggerScenarios":"A step calls putRow(rowMeta, row) where rowMeta.getValueMetaList() contains a value meta whose getName() is null/blank — e.g. fields added with new ValueMetaString(\"\") or null, or select/merge logic producing unnamed columns.","commonSituations":"User-defined Java/JavaScript steps emitting computed fields without naming them; Select Values or calculator producing empty field names; reading broken input files where a header cell is empty.","solutions":["Set a name on every ValueMetaInterface before putRow (vmi.setName(\"...\")).","Fix upstream metadata (Select Values / Calculator / UDJC) so renamed/derived fields always have names.","Set allowEmptyFieldNamesAndTypes(true) on the step only if blank names are intentionally acceptable.","In the input step, supply a name for columns whose header is blank."],"exampleFix":"// before\nrowMeta.addValueMeta(new ValueMetaString(\"\"));\n// after\nrowMeta.addValueMeta(new ValueMetaString(\"computed_field\"));","handlingStrategy":"validation","validationCode":"for (ValueMetaInterface vmi : rowMeta.getValueMetaList()) {\n  if (vmi.getName() == null || vmi.getName().trim().isEmpty())\n    throw new IllegalStateException(\"Unnamed output field: set a name before putRow\");\n}","typeGuard":null,"tryCatchPattern":"try { putRow(rowMeta, row); }\ncatch (KettleStepException e) { if (e.getMessage().contains(\"field name\")) { nameUnnamedFields(rowMeta); putRow(rowMeta, row); } else throw e; }","preventionTips":["Name every ValueMeta at creation time","Check header rows in file-based input for blanks","Only relax allowEmptyFieldNamesAndTypes deliberately"],"tags":["kettle","row-metadata","field-name","validation"],"backgroundTag":"empty-required-field","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"}