{"record":{"id":"73e0af4b9c36c805","repo":"pentaho/pentaho-kettle","slug":"tablecomparemeta-exception-nrerrorsfieldisnotspecified","errorCode":null,"errorMessage":"TableCompareMeta.Exception.NrErrorsFieldIsNotSpecified","messagePattern":"TableCompareMeta\\.Exception\\.NrErrorsFieldIsNotSpecified","errorType":"validation","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompareMeta.java","lineNumber":373,"sourceCode":"\n  @Override\n  public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException {\n    readData( stepnode, databases );\n  }\n\n  @Override\n  public Object clone() {\n    TableCompareMeta retval = (TableCompareMeta) super.clone();\n\n    return retval;\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info,\n    StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n\n    if ( Utils.isEmpty( nrErrorsField ) ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"TableCompareMeta.Exception.NrErrorsFieldIsNotSpecified\" ) );\n    }\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    }","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompareMeta.java#L355-L391","documentation":"TableCompareMeta.getFields() validates that every output field name is configured before appending output columns. This error means the 'number of errors' output field (nrErrorsField) is empty/unset, so the step cannot declare its output row structure.","triggerScenarios":"getFields(...) is called (during transformation initialization or metadata serialization) while the nrErrorsField property is null or empty — i.e. the step was configured programmatically or via XML that omitted the nr_errors_field tag.","commonSituations":"Building the step metadata in code/Jenkins-generated transformations without setting all output field names; hand-edited .ktr XML missing tags; upgrading transformations where new output fields were added in later versions.","solutions":["Set a non-empty name for the 'nr errors field' in the TableCompare step dialog (e.g. 'nr_errors').","In code, call meta.setNrErrorsField(\"nr_errors\") before the transformation runs.","Fix the .ktr XML so the <nr_errors_field> tag has a value."],"exampleFix":"// before\nTableCompareMeta meta = new TableCompareMeta();\n// meta.setNrErrorsField(...) never called\n// after\nTableCompareMeta meta = new TableCompareMeta();\nmeta.setNrErrorsField( \"nr_errors\" );","handlingStrategy":"validation","validationCode":"if ( meta.getNrErrorsField() == null || meta.getNrErrorsField().isEmpty() ) {\n  meta.setNrErrorsField( \"nr_errors\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  meta.getFields( bowl, rowMeta, origin, info, nextStep, space, repository, metaStore );\n} catch ( KettleStepException e ) {\n  if ( e.getMessage().contains( \"NrErrorsFieldIsNotSpecified\" ) ) {\n    meta.setNrErrorsField( \"nr_errors\" );\n  }\n}","preventionTips":["When building step metadata in code, set every output field name before adding the step to the transformation.","Validate the full meta (all six field names) in a unit test for generated transformations.","Never hand-edit .ktr XML without re-validating in Spoon."],"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"}