{"record":{"id":"06563ab5df56547a","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-field-fieldstream-i-in-the-input-rows-06563a","errorCode":null,"errorMessage":"Unable to find field [\" + fieldStream[i] + \"] in the input rows","messagePattern":"Unable to find field \\[\" \\+ fieldStream\\[i\\] \\+ \"\\] in the input rows","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java","lineNumber":696,"sourceCode":"\n  public SQLStatement getSQLStatements( TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,\n      Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    SQLStatement retval = new SQLStatement( stepMeta.getName(), databaseMeta, null ); // default: nothing to do!\n\n    if ( databaseMeta != null ) {\n      if ( prev != null && prev.size() > 0 ) {\n        // Copy the row\n        RowMetaInterface tableFields = new RowMeta();\n\n        // Now change the field names\n        for ( int i = 0; i < fieldTable.length; i++ ) {\n          ValueMetaInterface v = prev.searchValueMeta( fieldStream[i] );\n          if ( v != null ) {\n            ValueMetaInterface tableField = v.clone();\n            tableField.setName( fieldTable[i] );\n            tableFields.addValueMeta( tableField );\n          } else {\n            throw new KettleStepException( \"Unable to find field [\" + fieldStream[i] + \"] in the input rows\" );\n          }\n        }\n\n        if ( !Utils.isEmpty( tableName ) ) {\n          Database db = new Database( loggingObject, databaseMeta );\n          db.shareVariablesWith( transMeta );\n          try {\n            db.connect();\n\n            String schemaTable =\n                databaseMeta.getQuotedSchemaTableCombination( transMeta.environmentSubstitute( schemaName ), transMeta\n                    .environmentSubstitute( tableName ) );\n            String sql = db.getDDL( schemaTable, tableFields, null, false, null, true );\n\n            if ( sql.length() == 0 ) {\n              retval.setSQL( null );\n            } else {\n              retval.setSQL( sql );","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java#L678-L714","documentation":"GPLoadMeta.getSQLStatements() iterates the configured stream-to-table field mapping. For each entry it looks up the stream field name in the previous step's row layout via prev.searchValueMeta(fieldStream[i]); if the name is absent the mapping is broken and a KettleStepException is thrown. This is a fail-fast check so invalid mappings never reach generated SQL or the GPLoad load.","triggerScenarios":"Calling getSQLStatements()/sql() when fieldStream[i] does not exist in the row fields coming from the previous step — e.g. the upstream step was changed/renamed after the GPLoad mapping was configured, or the mapping references a deleted field.","commonSituations":"Renaming an upstream field without re-editing the GPLoad step; deleting a field in a Select Values/Filter step feeding GPLoad; loading a transformation whose upstream hop changed; copy-pasting steps between transformations with different row layouts.","solutions":["Open the GPLoad step dialog and re-map the Fields tab to field names that exist in the input rows","Run a Get Fields in the dialog to refresh the mapping from the actual upstream row layout","Check the upstream step for renamed/deleted fields and restore the original field name","Verify the field stream/table arrays have equal length and no stale entries in the step metadata (ktr XML)"],"exampleFix":"// before (stale mapping after upstream rename)\nfieldStream = new String[] { \"cust_name_old\" };\n// after\nfieldStream = new String[] { \"customer_name\" }; // matches prev.searchValueMeta()","handlingStrategy":"validation","validationCode":"// Java, before building/saving the step\nRowMetaInterface prev = transMeta.getPrevStepFields(stepMeta);\nfor (String streamField : fieldStream) {\n  if (prev.searchValueMeta(streamField) == null) {\n    throw new IllegalStateException(\"Field not in input rows: \" + streamField);\n  }\n}","typeGuard":null,"tryCatchPattern":"try { meta.getSQLStatements(...) } catch (KettleStepException e) { log.error(\"Broken GPLoad field mapping: \" + e.getMessage()); }","preventionTips":["Re-run Get Fields after any upstream step change","Rename fields via Select Values and update the GPLoad mapping in the same change","Validate transformations with a metadata consistency check before deployment"],"tags":["pdi","gpload","field-mapping","transform-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"}