{"record":{"id":"7e3413df657dbc72","repo":"pentaho/pentaho-kettle","slug":"combinationlookup-exception-fieldnotfound","errorCode":null,"errorMessage":"CombinationLookup.Exception.FieldNotFound","messagePattern":"CombinationLookup\\.Exception\\.FieldNotFound","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/combinationlookup/CombinationLookup.java","lineNumber":347,"sourceCode":"\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      data.schemaTable =\n        meta.getDatabaseMeta().getQuotedSchemaTableCombination( data.realSchemaName, data.realTableName );\n\n      determineTechKeyCreation();\n\n      // The indexes of the key values...\n      //\n      data.keynrs = new int[ meta.getKeyField().length ];\n\n      for ( int i = 0; i < meta.getKeyField().length; i++ ) {\n        data.keynrs[ i ] = getInputRowMeta().indexOfValue( meta.getKeyField()[ i ] );\n        if ( data.keynrs[ i ] < 0 ) {\n          // couldn't find field!\n          throw new KettleStepException( BaseMessages.getString(\n            PKG, \"CombinationLookup.Exception.FieldNotFound\", meta.getKeyField()[ i ] ) );\n        }\n      }\n\n      // Determine for each input field if we want it removed or not.\n      //\n      data.removeField = new boolean[ getInputRowMeta().size() ];\n\n      // Sort lookup values keys so that we\n      //\n      for ( int i = 0; i < getInputRowMeta().size(); i++ ) {\n        ValueMetaInterface valueMeta = getInputRowMeta().getValueMeta( i );\n        // Is this one of the keys?\n        int idx = Const.indexOfString( valueMeta.getName(), meta.getKeyField() );\n        data.removeField[ i ] = idx >= 0;\n      }\n\n      // Determine the metadata row to calculate hashcodes.","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/combinationlookup/CombinationLookup.java#L329-L365","documentation":"During first-row initialization, CombinationLookup resolves each configured key field's index in the incoming row. If a key field is absent, it throws a KettleStepException 'FieldNotFound' naming the field, since the dimension lookup cannot proceed without all key values.","triggerScenarios":"processRow, on the first row, loops meta.getKeyField(); getInputRowMeta().indexOfValue(keyField[i]) returns -1 for any configured key stream field.","commonSituations":"Upstream rename/drop of a key field; typo in the keyfield table on the dialog; hop reconfiguration after editing upstream steps; CSV input column removed.","solutions":["Open the CombinationLookup dialog and re-select the key fields from the actual upstream stream","Use Get Fields / Preview to confirm upstream field names","Restore the missing field in an upstream step (Calculator, Select Values, etc.)"],"exampleFix":"// before: dialog references stale field\nkeyField[0] = \"cust_id\";\n// after\nkeyField[0] = \"CUSTOMER_ID\"; // matches upstream stream field","handlingStrategy":"validation","validationCode":"for (String keyField : meta.getKeyField()) {\n  if (inputRowMeta.indexOfValue(keyField) < 0) {\n    throw new IllegalArgumentException(\"Missing key field in stream: \" + keyField);\n  }\n}","typeGuard":null,"tryCatchPattern":"try { trans.execute(null); trans.waitUntilFinished(); }\ncatch (KettleStepException e) { log.error(\"CombinationLookup key field missing: \" + e.getMessage()); }","preventionTips":["Refresh key fields with the dialog's field browser after upstream edits","Add an upstream Select Values step explicitly pinning required fields","Preview the input stream before production runs"],"tags":["kettle","pdi","field-not-found","dimension-lookup"],"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"}