{"record":{"id":"c547eaac8e44d66a","repo":"pentaho/pentaho-kettle","slug":"tablecomparemeta-exception-c547ea","errorCode":null,"errorMessage":"TableCompareMeta.Exception.NrErrorsRightJoinFieldNotSpecified","messagePattern":"TableCompareMeta\\.Exception\\.NrErrorsRightJoinFieldNotSpecified","errorType":"validation","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompareMeta.java","lineNumber":393,"sourceCode":"    }\n    if ( Utils.isEmpty( nrRecordsReferenceField ) ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"TableCompareMeta.Exception.NrRecordsReferenceFieldNotSpecified\" ) );\n    }\n    if ( Utils.isEmpty( nrRecordsCompareField ) ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"TableCompareMeta.Exception.NrRecordsCompareFieldNotSpecified\" ) );\n    }\n    if ( Utils.isEmpty( nrErrorsLeftJoinField ) ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"TableCompareMeta.Exception.NrErrorsLeftJoinFieldNotSpecified\" ) );\n    }\n    if ( Utils.isEmpty( nrErrorsInnerJoinField ) ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"TableCompareMeta.Exception.NrErrorsInnerJoinFieldNotSpecified\" ) );\n    }\n    if ( Utils.isEmpty( nrErrorsRightJoinField ) ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"TableCompareMeta.Exception.NrErrorsRightJoinFieldNotSpecified\" ) );\n    }\n\n    ValueMetaInterface nrErrorsValueMeta = new ValueMetaInteger( nrErrorsField );\n    nrErrorsValueMeta.setLength( 9 );\n    nrErrorsValueMeta.setOrigin( origin );\n    inputRowMeta.addValueMeta( nrErrorsValueMeta );\n\n    ValueMetaInterface nrRecordsReference =\n      new ValueMetaInteger( nrRecordsReferenceField );\n    nrRecordsReference.setLength( 9 );\n    nrRecordsReference.setOrigin( origin );\n    inputRowMeta.addValueMeta( nrRecordsReference );\n\n    ValueMetaInterface nrRecordsCompare = new ValueMetaInteger( nrRecordsCompareField );\n    nrRecordsCompare.setLength( 9 );\n    nrRecordsCompare.setOrigin( origin );\n    inputRowMeta.addValueMeta( nrRecordsCompare );","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompareMeta.java#L375-L411","documentation":"Sixth check in TableCompareMeta.getFields(): the 'nr errors right join' output field (nrErrorsRightJoinField) is not specified. It is the last required-field validation before the step appends its output value metadata.","triggerScenarios":"getFields(...) invoked with nrErrorsRightJoinField null/empty — thrown at TableCompareMeta.java:393 after all preceding checks pass.","commonSituations":"Programmatic construction missing the final setter; hand-edited .ktr XML; generated transformations from outdated templates.","solutions":["Set the 'nr errors right join field' in the step dialog (e.g. 'nr_errors_right').","In code, call meta.setNrErrorsRightJoinField(\"nr_errors_right\").","Fix the .ktr XML <nr_errors_right_join_field> tag."],"exampleFix":"// before\nmeta.setNrErrorsInnerJoinField( \"nr_errors_inner\" );\n// after\nmeta.setNrErrorsInnerJoinField( \"nr_errors_inner\" );\nmeta.setNrErrorsRightJoinField( \"nr_errors_right\" );","handlingStrategy":"validation","validationCode":"if ( meta.getNrErrorsRightJoinField() == null || meta.getNrErrorsRightJoinField().isEmpty() ) {\n  meta.setNrErrorsRightJoinField( \"nr_errors_right\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  meta.getFields( ... );\n} catch ( KettleStepException e ) {\n  if ( e.getMessage().contains( \"NrErrorsRightJoinFieldNotSpecified\" ) ) {\n    meta.setNrErrorsRightJoinField( \"nr_errors_right\" );\n  }\n}","preventionTips":["Remember the right-join field is the last required one; validate all six before execution.","Add an assertion-style preflight that calls getFields() on a scratch RowMeta during deployment.","Document required TableCompareMeta setters in team templates."],"tags":["kettle","configuration","validation","missing-field"],"backgroundTag":"empty-required-field","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"}