{"record":{"id":"c76cf12869030a1d","repo":"pentaho/pentaho-kettle","slug":"tablecompare-exception-comparetablenotspecified","errorCode":null,"errorMessage":"TableCompare.Exception.CompareTableNotSpecified","messagePattern":"TableCompare\\.Exception\\.CompareTableNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java","lineNumber":114,"sourceCode":"          .getReferenceTableField() ) );\n      }\n\n      // Compare schema\n      //\n      if ( Utils.isEmpty( meta.getCompareSchemaField() ) ) {\n        throw new KettleException( BaseMessages\n          .getString( PKG, \"TableCompare.Exception.CompareSchemaNotSpecified\" ) );\n      }\n      data.cmpSchemaIndex = getInputRowMeta().indexOfValue( meta.getCompareSchemaField() );\n      if ( data.cmpSchemaIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getCompareSchemaField() ) );\n      }\n\n      // Compare table\n      //\n      if ( Utils.isEmpty( meta.getCompareTableField() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CompareTableNotSpecified\" ) );\n      }\n      data.cmpTableIndex = getInputRowMeta().indexOfValue( meta.getCompareTableField() );\n      if ( data.cmpTableIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getCompareTableField() ) );\n      }\n\n      // Key fields\n      //\n      if ( Utils.isEmpty( meta.getKeyFieldsField() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.KeyFieldsNotSpecified\" ) );\n      }\n      data.keyFieldsIndex = getInputRowMeta().indexOfValue( meta.getKeyFieldsField() );\n      if ( data.keyFieldsIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getKeyFieldsField() ) );\n      }\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java#L96-L132","documentation":"TableCompare.processRow requires the compare table field to be configured. When meta.getCompareTableField() is empty it throws TableCompare.Exception.CompareTableNotSpecified, as the step needs an input field holding the name of the table to compare against.","triggerScenarios":"processRow executes with 'Compare table field' blank in the step metadata.","commonSituations":"Step configured programmatically without setCompareTableField, transformation edited in an older dialog that didn't save the value, or metadata injection leaving the key unmapped.","solutions":["Set the 'Compare table field' in the step dialog to an existing input field","Map compareTableField during metadata injection","Save the transformation so the setting persists","Preview rows to confirm the field carries non-empty table names"],"exampleFix":"// before\nmeta.setCompareTableField( \"\" ); // throws\n// after\nmeta.setCompareTableField( \"cmp_table\" );","handlingStrategy":"validation","validationCode":"if ( meta.getCompareTableField() == null || meta.getCompareTableField().isEmpty() ) {\n  throw new IllegalArgumentException( \"Compare table field must be set on TableCompareMeta\" );\n}","typeGuard":"boolean hasCompareTableField( TableCompareMeta m ) {\n  return m != null && m.getCompareTableField() != null && !m.getCompareTableField().isEmpty();\n}","tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"CompareTableNotSpecified\" ) ) {\n    logError( \"Set the Table Compare compare table field\" );\n  }\n}","preventionTips":["Verify all four field settings are populated before running","Include compareTableField in metadata injection mappings","Preview rows to ensure the field carries real table names","Save and reopen the transformation to confirm the setting persisted"],"tags":["configuration","missing-field","table-compare"],"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"}