{"record":{"id":"7688b1f95cb2c391","repo":"pentaho/pentaho-kettle","slug":"tablecompare-exception-compareschemanotspecified","errorCode":null,"errorMessage":"TableCompare.Exception.CompareSchemaNotSpecified","messagePattern":"TableCompare\\.Exception\\.CompareSchemaNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java","lineNumber":102,"sourceCode":"          .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() ) );\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      }","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java#L84-L120","documentation":"TableCompare.processRow requires the compare schema field to be configured. An empty meta.getCompareSchemaField() causes TableCompare.Exception.CompareSchemaNotSpecified, since the step needs an input field supplying the schema of the comparison table.","triggerScenarios":"processRow runs with 'Compare schema field' blank in the step settings.","commonSituations":"Programmatic construction without setCompareSchemaField, partially filled dialog (reference side set, compare side forgotten), or incomplete metadata injection mapping.","solutions":["Set the 'Compare schema field' in the step dialog to an input field name","Map compareSchemaField during metadata injection","Save the transformation to persist the setting","Validate both sides (reference and compare) are fully configured before running"],"exampleFix":"// before\nmeta.setCompareSchemaField( null ); // throws\n// after\nmeta.setCompareSchemaField( \"cmp_schema\" );","handlingStrategy":"validation","validationCode":"if ( meta.getCompareSchemaField() == null || meta.getCompareSchemaField().isEmpty() ) {\n  throw new IllegalArgumentException( \"Compare schema field must be set on TableCompareMeta\" );\n}","typeGuard":"boolean hasCompareSchemaField( TableCompareMeta m ) {\n  return m != null && m.getCompareSchemaField() != null && !m.getCompareSchemaField().isEmpty();\n}","tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"CompareSchemaNotSpecified\" ) ) {\n    logError( \"Set the Table Compare compare schema field\" );\n  }\n}","preventionTips":["Configure reference AND compare sides together","Add compareSchemaField to injection templates","Round-trip save/reopen the transformation to verify persistence"],"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"}