{"record":{"id":"d442ea16e5e59533","repo":"pentaho/pentaho-kettle","slug":"fuzzymatch-exception-couldnotfindlookfield","errorCode":null,"errorMessage":"FuzzyMatch.Exception.CouldnotFindLookField","messagePattern":"FuzzyMatch\\.Exception\\.CouldnotFindLookField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fuzzymatch/FuzzyMatch.java","lineNumber":89,"sourceCode":"    if ( isDetailed() ) {\n      logDetailed( BaseMessages.getString( PKG, \"FuzzyMatch.Log.ReadingFromStream\" )\n        + data.infoStream.getStepname() + \"]\" );\n    }\n\n    boolean firstRun = true;\n    // Which row set do we read from?\n    //\n    RowSet rowSet = findInputRowSet( data.infoStream.getStepname() );\n    Object[] rowData = getRowFrom( rowSet ); // rows are originating from \"lookup_from\"\n\n    while ( rowData != null ) {\n      if ( firstRun ) {\n        data.infoMeta = rowSet.getRowMeta().clone();\n        // Check lookup field\n        int indexOfLookupField = data.infoMeta.indexOfValue( environmentSubstitute( meta.getLookupField() ) );\n        if ( indexOfLookupField < 0 ) {\n          // The field is unreachable !\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"FuzzyMatch.Exception.CouldnotFindLookField\", meta.getLookupField() ) );\n        }\n        data.infoCache = new RowMeta();\n        ValueMetaInterface keyValueMeta = data.infoMeta.getValueMeta( indexOfLookupField );\n        keyValueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );\n        data.infoCache.addValueMeta( keyValueMeta );\n        // Add key\n        data.indexOfCachedFields[0] = indexOfLookupField;\n\n        // Check additional fields\n        if ( data.addAdditionalFields ) {\n          ValueMetaInterface additionalFieldValueMeta;\n          for ( int i = 0; i < meta.getValue().length; i++ ) {\n            int fi = i + 1;\n            data.indexOfCachedFields[fi] = data.infoMeta.indexOfValue( meta.getValue()[i] );\n            if ( data.indexOfCachedFields[fi] < 0 ) {\n              // The field is unreachable !\n              throw new KettleException( BaseMessages.getString(","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fuzzymatch/FuzzyMatch.java#L71-L107","documentation":"FuzzyMatch.readLookupValues validates the info (lookup) stream's row metadata and throws this KettleException when the configured Lookup Field cannot be found in the lookup stream (indexOfValue < 0). It fails fast at the first row instead of silently matching against a missing column.","triggerScenarios":"The Fuzzy Match step's 'Lookup field' setting names a column that does not exist in the second (lookup) input stream when the first lookup row is read in processRow.","commonSituations":"Typo in the lookup field name; upstream lookup-stream step renamed/removed the column; field was added as environment variable placeholder that didn't resolve; copying a transformation between environments where stream layouts differ.","solutions":["Open the Fuzzy Match step and re-select the Lookup field from the dropdown so it matches the actual lookup-stream column.","Check the step feeding the lookup side of the hop and confirm the column name (case-sensitive) is produced there.","If a variable is used for the field name, verify the variable resolves correctly (add a 'Get Variables' log or use environmentSubstitute debugging).","Re-run after adding the missing column via a Select Values or other step if the field is genuinely required."],"exampleFix":"// before\nLookup field: 'cust_id'\n// after (column actually named 'customer_id' in lookup stream)\nLookup field: 'customer_id'","handlingStrategy":"validation","validationCode":"// Before the Fuzzy Match step, assert the lookup field exists:\nint idx = lookupRowMeta.indexOfValue(lookupFieldName);\nif (idx < 0) {\n  throw new KettleException(\"Lookup field not found in lookup stream: \" + lookupFieldName);\n}","typeGuard":null,"tryCatchPattern":"try {\n  processRow();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"CouldnotFindLookField\")) {\n    logError(\"Check Fuzzy Match lookup field config vs lookup stream layout: \" + e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Re-open the step dialog after changing upstream steps so field lists refresh.","Avoid hardcoded field names; prefer selecting from the dropdown.","Preview the lookup stream before running the full transformation.","Watch for renames introduced by Select Values steps."],"tags":["fuzzy-match","lookup-field","configuration"],"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"}