pentaho/pentaho-kettle · error · KettleException
TableCompare.Exception.ReferenceSchemaNotSpecified
Error message
TableCompare.Exception.ReferenceSchemaNotSpecified
What it means
TableCompare.processRow validates its required input fields before comparing two tables. When the reference schema field name configured in the step metadata is empty, it throws a localized KettleException (TableCompare.Exception.ReferenceSchemaNotSpecified) because it cannot locate which incoming row field holds the reference schema.
Solutions
- Open the Table Compare step dialog and set the 'Reference schema field' to a field present in the input stream
- If injecting metadata, map the referenceSchemaField key to a non-empty source column
- Re-save the transformation to persist the field name
- Add a Select values / validation step upstream to guarantee the field exists
Example fix
// before TableCompareMeta meta = new TableCompareMeta(); meta.setReferenceSchemaField( null ); // throws at runtime // after meta.setReferenceSchemaField( "ref_schema" ); // non-empty input field name
Defensive patterns
Strategy: validation
Validate before calling
// before running the transformation, assert the setting exists
if ( meta.getReferenceSchemaField() == null || meta.getReferenceSchemaField().isEmpty() ) {
throw new IllegalArgumentException( "Reference schema field must be set on TableCompareMeta" );
} Type guard
boolean hasReferenceSchemaField( TableCompareMeta m ) {
return m != null && m.getReferenceSchemaField() != null && !m.getReferenceSchemaField().isEmpty();
} Try / catch
try {
trans.execute( null );
} catch ( KettleException e ) {
if ( e.getMessage().contains( "ReferenceSchemaNotSpecified" ) ) {
logError( "Configure the Table Compare reference schema field before running" );
}
} Prevention
- Always fill all four field settings (ref schema/table, cmp schema/table) in the dialog
- Set the fields programmatically right after constructing TableCompareMeta
- Use metadata injection templates that include all four keys
- Save the transformation and reopen it to confirm settings persisted
When it happens
Trigger: processRow runs with meta.getReferenceSchemaField() empty — the step was configured without the 'Reference schema field' setting, or the setting was lost/cleared in the transformation metadata.
Common situations: Building the step programmatically without setting referenceSchemaField, importing an old transformation where the option was never filled, or a metadata-injection run leaving the field unmapped.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- TableCompare.Exception.CompareSchemaNotSpecified
- TableCompare.Exception.CompareTableNotSpecified
- TableCompare.Exception.ReferenceTableNotSpecified
- ChangeFileEncoding.Error.FilenameFieldMissing
- ChangeFileEncoding.Error.TargetFilenameFieldMissing
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/a92696d9c0909257.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java:78
if ( r == null ) { // no more input to be expected...
setOutputDone();
return false;
}
if ( first ) {
first = false;
// What's the format of the output row?
//
data.outputRowMeta = getInputRowMeta().clone();
meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
metaStore );
// Reference schema
//
if ( Utils.isEmpty( meta.getReferenceSchemaField() ) ) {
throw new KettleException( BaseMessages.getString(
PKG, "TableCompare.Exception.ReferenceSchemaNotSpecified" ) );
}
data.refSchemaIndex = getInputRowMeta().indexOfValue( meta.getReferenceSchemaField() );
if ( data.refSchemaIndex < 0 ) {
throw new KettleException( BaseMessages.getString( PKG, "TableCompare.Exception.CanNotFindField", meta
.getReferenceSchemaField() ) );
}
// Reference table
//
if ( Utils.isEmpty( meta.getReferenceTableField() ) ) {
throw new KettleException( BaseMessages.getString(
PKG, "TableCompare.Exception.ReferenceTableNotSpecified" ) );
}
data.refTableIndex = getInputRowMeta().indexOfValue( meta.getReferenceTableField() );
if ( data.refTableIndex < 0 ) {
throw new KettleException( BaseMessages.getString( PKG, "TableCompare.Exception.CanNotFindField", meta
.getReferenceTableField() ) );View on GitHub (pinned to f3058517a1)