{"record":{"id":"0fd665c201095fc6","repo":"pentaho/pentaho-kettle","slug":"dimensionlookupmeta-error-notechnicalkeyspecified","errorCode":null,"errorMessage":"DimensionLookupMeta.Error.NoTechnicalKeySpecified","messagePattern":"DimensionLookupMeta\\.Error\\.NoTechnicalKeySpecified","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/dimensionlookup/DimensionLookupMeta.java","lineNumber":759,"sourceCode":"    // It doesn't make sense to use it in the SCD context but people try it anyway\n    //\n    for ( ValueMetaInterface valueMeta : row.getValueMetaList() ) {\n      valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );\n\n      // Also change the trim type to \"None\" as this can cause trouble\n      // during compare of the data when there are leading/trailing spaces in the target table\n      //\n      valueMeta.setTrimType( ValueMetaInterface.TRIM_TYPE_NONE );\n    }\n\n    // technical key can't be null\n\n    if ( Utils.isEmpty( keyField ) ) {\n      String message =\n          BaseMessages.getString( PKG, \"DimensionLookupMeta.Error.NoTechnicalKeySpecified\" );\n\n      logError( message );\n      throw new KettleStepException( message );\n    }\n\n    ValueMetaInterface v = new ValueMetaInteger( keyField );\n    if ( keyRename != null && keyRename.length() > 0 ) {\n      v.setName( keyRename );\n    }\n\n    v.setLength( 9 );\n    v.setPrecision( 0 );\n    v.setOrigin( name );\n    row.addValueMeta( v );\n\n    // retrieve extra fields on lookup?\n    // Don't bother if there are no return values specified.\n    if ( !update && fieldLookup.length > 0 ) {\n      Database db = null;\n      try {\n        // Get the rows from the table...","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/dimensionlookup/DimensionLookupMeta.java#L741-L777","documentation":"During DimensionLookupMeta.check() validation, if the technical/surrogate key field name (keyField) is empty, the step logs the localized message 'No technical key specified' and throws a KettleStepException. The dimension lookup cannot function without a technical key column, so the configuration is rejected at design time.","triggerScenarios":"getChecks()/check() is called (e.g. when saving or verifying the step in Spoon) with meta.getKeyField() empty — the 'Technical key field' box was never filled in.","commonSituations":"Creating the step programmatically without setting the key field; loading metadata where the key field was cleared; renaming/dropping the surrogate key column and clearing the setting; XML templates missing the key_field tag.","solutions":["Open the Dimension Lookup step and set the 'Technical key field' in the key fields section","If building metadata in code, call meta.setKeyField(\"your_surrogate_key\") before the transformation runs","If the field was renamed in the table, update the step to the new column name","Re-save the transformation after fixing so check() passes"],"exampleFix":"// before\nDimensionLookupMeta meta = new DimensionLookupMeta();\nmeta.setKeyField(null); // throws NoTechnicalKeySpecified\n// after\nmeta.setKeyField(\"dim_customer_tk\");","handlingStrategy":"validation","validationCode":"// Java: validate step meta before adding it to a transformation\nDimensionLookupMeta meta = ...;\nif (meta.getKeyField() == null || meta.getKeyField().trim().isEmpty()) {\n  throw new IllegalArgumentException(\"DimensionLookup requires a technical key field\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  stepMeta.check(remarks, transMeta, stepMeta, prev, inputFields, outputFields, metaStore, sp);\n} catch (KettleStepException e) {\n  if (e.getMessage().contains(\"NoTechnicalKeySpecified\") || e.getMessage().contains(\"technical key\")) {\n    meta.setKeyField(\"dim_tk\"); // apply default and re-check\n  } else throw e;\n}","preventionTips":["Always call setKeyField when constructing DimensionLookupMeta programmatically","Run the step's check() validation before saving/executing transformations","Keep the technical key column present in the dimension table DDL","Include the key_field tag in any hand-built step XML templates"],"tags":["configuration","validation","dimension-lookup","technical-key"],"backgroundTag":"missing-required-config-field","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"}