pentaho/pentaho-kettle · error · KettleStepException
TableCompareMeta.Exception.NrErrorsFieldIsNotSpecified
Error message
TableCompareMeta.Exception.NrErrorsFieldIsNotSpecified
What it means
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.
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.
Example fix
// before TableCompareMeta meta = new TableCompareMeta(); // meta.setNrErrorsField(...) never called // after TableCompareMeta meta = new TableCompareMeta(); meta.setNrErrorsField( "nr_errors" );
Defensive patterns
Strategy: validation
Validate before calling
if ( meta.getNrErrorsField() == null || meta.getNrErrorsField().isEmpty() ) {
meta.setNrErrorsField( "nr_errors" );
} Try / catch
try {
meta.getFields( bowl, rowMeta, origin, info, nextStep, space, repository, metaStore );
} catch ( KettleStepException e ) {
if ( e.getMessage().contains( "NrErrorsFieldIsNotSpecified" ) ) {
meta.setNrErrorsField( "nr_errors" );
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- GetTableNames.Log.NoSchemaField
- TableCompareMeta.Exception.NrRecordsReferenceFieldNotSpecifi…
- TableCompareMeta.Exception.NrErrorsInnerJoinFieldNotSpecifie…
- TableCompareMeta.Exception.NrErrorsRightJoinFieldNotSpecifie…
- TableCompareMeta.Exception.NrErrorsLeftJoinFieldNotSpecified
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/73e0af4b9c36c805.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompareMeta.java:373
@Override
public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException {
readData( stepnode, databases );
}
@Override
public Object clone() {
TableCompareMeta retval = (TableCompareMeta) super.clone();
return retval;
}
@Override
public void getFields( Bowl bowl, RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info,
StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
if ( Utils.isEmpty( nrErrorsField ) ) {
throw new KettleStepException( BaseMessages.getString(
PKG, "TableCompareMeta.Exception.NrErrorsFieldIsNotSpecified" ) );
}
if ( Utils.isEmpty( nrRecordsReferenceField ) ) {
throw new KettleStepException( BaseMessages.getString(
PKG, "TableCompareMeta.Exception.NrRecordsReferenceFieldNotSpecified" ) );
}
if ( Utils.isEmpty( nrRecordsCompareField ) ) {
throw new KettleStepException( BaseMessages.getString(
PKG, "TableCompareMeta.Exception.NrRecordsCompareFieldNotSpecified" ) );
}
if ( Utils.isEmpty( nrErrorsLeftJoinField ) ) {
throw new KettleStepException( BaseMessages.getString(
PKG, "TableCompareMeta.Exception.NrErrorsLeftJoinFieldNotSpecified" ) );
}
if ( Utils.isEmpty( nrErrorsInnerJoinField ) ) {
throw new KettleStepException( BaseMessages.getString(
PKG, "TableCompareMeta.Exception.NrErrorsInnerJoinFieldNotSpecified" ) );
}View on GitHub (pinned to f3058517a1)