{"record":{"id":"cd4f3858ae76eb59","repo":"pentaho/pentaho-kettle","slug":"concatfields-error-remainingfieldnotfoundinputstream","errorCode":"ConcatFields.Error.RemainingFieldNotFoundInputStream","errorMessage":"ConcatFields.Error.RemainingFieldNotFoundInputStream","messagePattern":"ConcatFields\\.Error\\.RemainingFieldNotFoundInputStream","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFields.java","lineNumber":189,"sourceCode":"      if ( !meta.isFileNameInField() && meta.isHeaderEnabled() && data.outputRowMeta != null ) {\n        writeHeader();\n        // add an empty line for the header\n        Object[] row = new Object[ data.outputRowMeta.size() ];\n        putRowFromStream( row );\n      }\n    }\n  }\n\n  void prepareForReMap() throws KettleStepException {\n    // prepare for re-map when removeSelectedFields\n    if ( meta.isRemoveSelectedFields() ) {\n      data.remainingFieldsInputOutputMapping = new int[ data.outputRowMeta.size() - 1 ]; // -1: don't need the new\n      // target field\n      String[] fieldNames = data.outputRowMeta.getFieldNames();\n      for ( int i = 0; i < fieldNames.length - 1; i++ ) { // -1: don't search the new target field\n        data.remainingFieldsInputOutputMapping[ i ] = data.inputRowMetaModified.indexOfValue( fieldNames[ i ] );\n        if ( data.remainingFieldsInputOutputMapping[ i ] < 0 ) {\n          throw new KettleStepException( BaseMessages.getString( PKG,\n            \"ConcatFields.Error.RemainingFieldNotFoundInputStream\", \"\" + fieldNames[ i ] ) );\n        }\n      }\n    }\n  }\n\n  // reads the row from the stream, flushs, add target field and call putRow()\n  Object[] putRowFromStream( Object[] r ) throws KettleStepException {\n\n    byte[] targetBinary = ( (ConcatFieldsOutputStream) data.writer ).read();\n    if ( r == null && targetBinary == null ) {\n      return null; // special condition of header/footer/split\n    }\n\n    Object[] outputRowData = prepareOutputRow( r );\n\n    // add target field\n    if ( outputRowData == null ) { // special condition of header/footer/split","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFields.java#L171-L207","documentation":"When ConcatFields maps remaining (non-concatenated) fields from input to output, prepareForReMap looks up each output field name in the modified input row metadata. A -1 result means one of the remaining fields is missing from the input stream, so it throws this exception naming the field.","triggerScenarios":"Called from processRow when output row metadata contains fields (other than the new target field) that cannot be found in data.inputRowMetaModified.","commonSituations":"A field present in the output layout is not produced by the input stream — e.g., transformation edited so an upstream step no longer emits the field; metadata drift between designed and actual row layouts.","solutions":["Ensure the input stream supplies every non-target field expected in the output row.","Remove or rename stale fields in the transformation design.","Re-verify hop field layouts after upstream changes and re-save the transformation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"String[] names = outputRowMeta.getFieldNames();\nfor ( int i = 0; i < names.length - 1; i++ ) {\n  if ( inputRowMetaModified.indexOfValue( names[i] ) < 0 ) throw new IllegalArgumentException( \"Missing field: \" + names[i] );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleStepException e ) {\n  if ( e.getMessage().contains( \"RemainingFieldNotFoundInputStream\" ) ) {\n    logError( \"Input stream lacks a designed output field: \" + e.getMessage() );\n  }\n}","preventionTips":["Keep the transformation's designed row layout in sync with the actual input stream.","Avoid manual edits to step field lists.","Re-preview rows after upstream modifications."],"tags":["kettle","pdi","field-mapping","stream-metadata"],"backgroundTag":"resource-not-found","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"}