{"record":{"id":"41dc941a6a5d5c4d","repo":"pentaho/pentaho-kettle","slug":"tablecompare-exception-keydescriptionfieldnotspecified","errorCode":null,"errorMessage":"TableCompare.Exception.KeyDescriptionFieldNotSpecified","messagePattern":"TableCompare\\.Exception\\.KeyDescriptionFieldNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java","lineNumber":148,"sourceCode":"          .getKeyFieldsField() ) );\n      }\n\n      // Exclude fields\n      //\n      if ( Utils.isEmpty( meta.getExcludeFieldsField() ) ) {\n        throw new KettleException( BaseMessages\n          .getString( PKG, \"TableCompare.Exception.ExcludeFieldsNotSpecified\" ) );\n      }\n      data.excludeFieldsIndex = getInputRowMeta().indexOfValue( meta.getExcludeFieldsField() );\n      if ( data.excludeFieldsIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getExcludeFieldsField() ) );\n      }\n\n      // error handling: Key description\n      //\n      if ( Utils.isEmpty( meta.getKeyDescriptionField() ) ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TableCompare.Exception.KeyDescriptionFieldNotSpecified\" ) );\n      }\n      data.keyDescIndex = getInputRowMeta().indexOfValue( meta.getKeyDescriptionField() );\n      if ( data.keyDescIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getKeyDescriptionField() ) );\n      }\n\n      // error handling: reference value\n      //\n      if ( Utils.isEmpty( meta.getValueReferenceField() ) ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TableCompare.Exception.ValueReferenceFieldNotSpecified\" ) );\n      }\n      data.valueReferenceIndex = getInputRowMeta().indexOfValue( meta.getValueReferenceField() );\n      if ( data.valueReferenceIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getValueReferenceField() ) );","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java#L130-L166","documentation":"TableCompare.processRow() validates that the error-handling 'Key description' field is configured and throws this KettleException (KeyDescriptionFieldNotSpecified) when meta.getKeyDescriptionField() is empty. This is a required-configuration check: the step writes a key description string per row, so the target column name must be set up front.","triggerScenarios":"Utils.isEmpty(meta.getKeyDescriptionField()) is true in processRow() — 'Key description fieldname' left blank in the TableCompare dialog or in programmatically built metadata.","commonSituations":"Building TableCompareMeta in tests or via metadata injection and setting only some fields; forgetting error-handling outputs while filling comparison inputs; a dialog saved with defaults that leave error-handling fields empty.","solutions":["Fill in 'Key description fieldname' in the TableCompare dialog.","In code, call meta.setKeyDescriptionField(\"...\") with a column that exists in the input stream.","Run meta.setDefault() after construction to ensure all required settings are populated before execution."],"exampleFix":"// before\nmeta.setCompareTableField( \"compare_table\" );\nmeta.setKeyFieldsField( \"key_fields\" );\nmeta.setExcludeFieldsField( \"exclude_fields\" ); // key description missing\n// after\nmeta.setKeyDescriptionField( \"key_description\" );","handlingStrategy":"validation","validationCode":"if ( meta.getKeyDescriptionField() == null || meta.getKeyDescriptionField().isEmpty() ) {\n  throw new IllegalStateException( \"TableCompare: Key description fieldname is required\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleException e ) {\n  if ( String.valueOf( e.getLocalizedMessage() ).contains( \"KeyDescriptionFieldNotSpecified\" ) ) {\n    logError( \"Set 'Key description fieldname' in the TableCompare dialog and rerun\" );\n  }\n  setErrors( 1 );\n  stopAll();\n}","preventionTips":["Don't overlook error-handling output fields — they are required, not optional.","Use meta.setDefault() when building metadata programmatically.","Add a startup validator that checks all six TableCompare field settings."],"tags":["kettle","missing-config","transform-step"],"backgroundTag":"missing-required-argument","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"}