{"record":{"id":"660f8cd189d3f37e","repo":"pentaho/pentaho-kettle","slug":"group-field-0-could-not-be-found-in-the-input-stream","errorCode":null,"errorMessage":"Group field '{0}' could not be found in the input stream","messagePattern":"Group field '(.+?)' could not be found in the input stream","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/transexecutor/TransExecutor.java","lineNumber":182,"sourceCode":"    // internal transformation's execution output\n    transExecutorData.setResultRowsOutputRowMeta( new RowMeta() );\n    if ( meta.getOutputRowsSourceStepMeta() != null ) {\n      meta.prepareResultsRowsFields( transExecutorData.getResultRowsOutputRowMeta() );\n      transExecutorData.setResultRowsRowSet( findOutputRowSet( meta.getOutputRowsSourceStepMeta().getName() ) );\n    }\n\n    // executor's self output is exactly its input\n    if ( meta.getExecutorsOutputStepMeta() != null ) {\n      transExecutorData.setExecutorStepOutputRowMeta( getInputRowMeta().clone() );\n      transExecutorData.setExecutorStepOutputRowSet( findOutputRowSet( meta.getExecutorsOutputStepMeta().getName() ) );\n    }\n\n    // Remember which column to group on, if any...\n    transExecutorData.groupFieldIndex = -1;\n    if ( !Utils.isEmpty( transExecutorData.groupField ) ) {\n      transExecutorData.groupFieldIndex = getInputRowMeta().indexOfValue( transExecutorData.groupField );\n      if ( transExecutorData.groupFieldIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TransExecutor.Exception.GroupFieldNotFound\", transExecutorData.groupField ) );\n      }\n      transExecutorData.groupFieldMeta = getInputRowMeta().getValueMeta( transExecutorData.groupFieldIndex );\n    }\n  }\n\n  private void executeTransformation( List<String> incomingFieldValues ) throws KettleException {\n    TransExecutorData transExecutorData = getData();\n    // If we got 0 rows on input we don't really want to execute the transformation\n    if ( transExecutorData.groupBuffer.isEmpty() ) {\n      return;\n    }\n    transExecutorData.groupTimeStart = System.currentTimeMillis();\n\n    if ( first ) {\n      discardLogLines( transExecutorData );\n    }\n","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/transexecutor/TransExecutor.java#L164-L200","documentation":"TransExecutor.initOnFirstProcessingIteration() throws this when the configured group field does not exist in the incoming row structure. The step looks up groupField via getInputRowMeta().indexOfValue() and aborts when the index is -1, since grouping cannot proceed without the column.","triggerScenarios":"First row arrives at the TransExecutor step with 'group field' set (TransExecutor.Exception.GroupFieldNotFound) but the field name is absent from the input row: renamed upstream field, wrong field name typed in the dialog, or upstream step removed the column.","commonSituations":"Renaming a field in the step before TransExecutor without updating the executor config; passing different row layouts (e.g. after a Select values remove); case-mismatched field names.","solutions":["Open the TransExecutor dialog and re-select the group field from the actual upstream field list.","Ensure the upstream step actually emits the field (check with a preview/get fields).","Clear the group field setting if grouping was not intended.","Match field name exactly, including case."],"exampleFix":"// before (dialog config)\ngroup field: \"CustomerID\"\n// after (matches upstream row)\ngroup field: \"customer_id\"","handlingStrategy":"validation","validationCode":"// Before running, confirm group field exists in upstream row metadata\nRowMetaInterface prev = transMeta.getPrevStepFields(stepName);\nString groupField = transExecutorMeta.getGroupField();\nif (groupField != null && !groupField.isEmpty() && prev.indexOfValue(groupField) < 0) {\n  throw new IllegalStateException(\"Group field not in upstream rows: \" + groupField);\n}","typeGuard":"boolean groupFieldPresent(RowMetaInterface rowMeta, String field) {\n  return field == null || field.isEmpty() || rowMeta.indexOfValue(field) >= 0;\n}","tryCatchPattern":"try { trans.execute(new String[0]); }\ncatch (KettleException e) {\n  if (e.getMessage().contains(\"Group field\")) {\n    log.error(\"Fix TransExecutor group field config: {}\", e.getMessage());\n  }\n}","preventionTips":["Always pick the group field from the dialog's field dropdown, not free text","Re-check executor config after renaming/removing upstream fields","Preview upstream rows before enabling grouping"],"tags":["kettle","field-mapping","configuration","executor"],"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"}