{"record":{"id":"74903a4cb2d8eaff","repo":"pentaho/pentaho-kettle","slug":"tablecompare-exception-referencetablenotspecified","errorCode":null,"errorMessage":"TableCompare.Exception.ReferenceTableNotSpecified","messagePattern":"TableCompare\\.Exception\\.ReferenceTableNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java","lineNumber":90,"sourceCode":"      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      // Reference schema\n      //\n      if ( Utils.isEmpty( meta.getReferenceSchemaField() ) ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TableCompare.Exception.ReferenceSchemaNotSpecified\" ) );\n      }\n      data.refSchemaIndex = getInputRowMeta().indexOfValue( meta.getReferenceSchemaField() );\n      if ( data.refSchemaIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getReferenceSchemaField() ) );\n      }\n\n      // Reference table\n      //\n      if ( Utils.isEmpty( meta.getReferenceTableField() ) ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TableCompare.Exception.ReferenceTableNotSpecified\" ) );\n      }\n      data.refTableIndex = getInputRowMeta().indexOfValue( meta.getReferenceTableField() );\n      if ( data.refTableIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .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() ) );","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java#L72-L108","documentation":"TableCompare.processRow requires the reference table field to be configured. When meta.getReferenceTableField() is empty it throws TableCompare.Exception.ReferenceTableNotSpecified because it cannot know which input field carries the reference table name.","triggerScenarios":"processRow executes with the step's 'Reference table field' setting blank — never set, cleared, or not injected.","commonSituations":"Programmatic step construction omitting setReferenceTableField, template transformations with unfilled settings, or metadata injection mapping missing the table field key.","solutions":["Set the 'Reference table field' in the step dialog to an existing input field","Map referenceTableField during metadata injection","Persist the change by saving the transformation","Verify with a preview that the field is populated on incoming rows"],"exampleFix":"// before\nmeta.setReferenceTableField( \"\" ); // throws\n// after\nmeta.setReferenceTableField( \"ref_table\" );","handlingStrategy":"validation","validationCode":"if ( meta.getReferenceTableField() == null || meta.getReferenceTableField().isEmpty() ) {\n  throw new IllegalArgumentException( \"Reference table field must be set on TableCompareMeta\" );\n}","typeGuard":"boolean hasReferenceTableField( TableCompareMeta m ) {\n  return m != null && m.getReferenceTableField() != null && !m.getReferenceTableField().isEmpty();\n}","tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"ReferenceTableNotSpecified\" ) ) {\n    logError( \"Set the Table Compare reference table field\" );\n  }\n}","preventionTips":["Fill all four field settings before saving the transformation","Include referenceTableField in metadata injection mappings","Verify saved XML/KTR contains the setting"],"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"}