{"record":{"id":"f2de4be24d3dc443","repo":"pentaho/pentaho-kettle","slug":"tablecompare-exception-valuereferencefieldnotspecified","errorCode":null,"errorMessage":"TableCompare.Exception.ValueReferenceFieldNotSpecified","messagePattern":"TableCompare\\.Exception\\.ValueReferenceFieldNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java","lineNumber":160,"sourceCode":"          .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() ) );\n      }\n\n      // error handling: compare value\n      //\n      if ( Utils.isEmpty( meta.getValueCompareField() ) ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TableCompare.Exception.ValueCompareFieldNotSpecified\" ) );\n      }\n      data.valueCompareIndex = getInputRowMeta().indexOfValue( meta.getValueCompareField() );\n      if ( data.valueCompareIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getValueCompareField() ) );","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java#L142-L178","documentation":"TableCompare.processRow() requires the error-handling 'Value reference' field and throws this KettleException (ValueReferenceFieldNotSpecified) when meta.getValueReferenceField() is empty. Required-configuration guard: the step needs to know which column carries the reference value per row before processing.","triggerScenarios":"Utils.isEmpty(meta.getValueReferenceField()) is true in processRow() — 'Value reference fieldname' is blank in the TableCompare dialog or in code-built metadata.","commonSituations":"Programmatic metadata construction (as in the calling test) omitting setSetValueReferenceField; incomplete dialog saves; copying steps between transformations where fields were reset.","solutions":["Enter 'Value reference fieldname' in the TableCompare dialog.","In code, call meta.setValueReferenceField(\"...\") before running the transformation.","Assert all six required field-name settings are non-empty in a pre-run metadata validation."],"exampleFix":"// before\nTableCompareMeta meta = new TableCompareMeta();\n// ... other fields set ...\n// value reference never set\n// after\nmeta.setValueReferenceField( \"value_reference\" );","handlingStrategy":"validation","validationCode":"if ( meta.getValueReferenceField() == null || meta.getValueReferenceField().isEmpty() ) {\n  throw new IllegalStateException( \"TableCompare: Value reference fieldname is required\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleException e ) {\n  if ( String.valueOf( e.getLocalizedMessage() ).contains( \"ValueReferenceFieldNotSpecified\" ) ) {\n    logError( \"Set 'Value reference fieldname' in the TableCompare dialog and rerun\" );\n  }\n  setErrors( 1 );\n  stopAll();\n}","preventionTips":["Complete all setter calls when constructing TableCompareMeta in code.","Use meta.setDefault() immediately after construction.","Fail fast in CI by validating step metadata before executing transformations."],"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"}