{"record":{"id":"0f1fdf951b37c22c","repo":"pentaho/pentaho-kettle","slug":"tablecompare-exception-valuecomparefieldnotspecified","errorCode":null,"errorMessage":"TableCompare.Exception.ValueCompareFieldNotSpecified","messagePattern":"TableCompare\\.Exception\\.ValueCompareFieldNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java","lineNumber":172,"sourceCode":"          .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() ) );\n      }\n\n    } // end if first\n\n    Object[] fields = compareTables( getInputRowMeta(), r );\n    Object[] outputRowData = RowDataUtil.addRowData( r, getInputRowMeta().size(), fields );\n    putRow( data.outputRowMeta, outputRowData ); // copy row to output rowset(s);\n    return true;\n  }\n\n  private Object[] compareTables( RowMetaInterface rowMeta, Object[] r ) throws KettleException {\n    try {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java#L154-L190","documentation":"TableCompare.processRow() requires the error-handling 'Value compare' field and throws this KettleException (ValueCompareFieldNotSpecified) when meta.getValueCompareField() is empty. This is the final required-configuration check in the field-resolution block: the step needs the column carrying the compare value per row.","triggerScenarios":"Utils.isEmpty(meta.getValueCompareField()) is true in processRow() — 'Value compare fieldname' left blank in the TableCompare dialog or in programmatically constructed metadata.","commonSituations":"Building TableCompareMeta in tests/metadata injection and stopping before setting the last fields; incomplete dialog save; migration losing error-handling settings.","solutions":["Fill in 'Value compare fieldname' in the TableCompare dialog.","In code, call meta.setValueCompareField(\"...\") — or call meta.setDefault() to populate all required settings.","Add a pre-execution check listing all required field names and failing fast when any is empty."],"exampleFix":"// before\nmeta.setValueReferenceField( \"value_reference\" );\n// value compare never set -> ValueCompareFieldNotSpecified\n// after\nmeta.setValueCompareField( \"value_compare\" );","handlingStrategy":"validation","validationCode":"if ( meta.getValueCompareField() == null || meta.getValueCompareField().isEmpty() ) {\n  throw new IllegalStateException( \"TableCompare: Value compare fieldname is required\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleException e ) {\n  if ( String.valueOf( e.getLocalizedMessage() ).contains( \"ValueCompareFieldNotSpecified\" ) ) {\n    logError( \"Set 'Value compare fieldname' in the TableCompare dialog and rerun\" );\n  }\n  setErrors( 1 );\n  stopAll();\n}","preventionTips":["Finish the full setter sequence (compare table, key fields, exclude fields, key description, value reference, value compare) when building metadata.","Call meta.setDefault() to catch unset required fields early.","Validate all six settings non-empty before transformation execution."],"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"}