pentaho/pentaho-kettle · error · KettleException

GetTableNames.Log.NoSchemaField

GetTableNames.Log.NoSchemaField

Error message

GetTableNames.Log.NoSchemaField

What it means

The Get Table Names step can read schema names dynamically from an incoming field, but processRow requires that field to be configured. When the 'schema fieldname' setting is empty, the step logs and throws this localized KettleException instead of continuing. It is a pure configuration validation error at row-processing time.

Solutions

  1. Open the Get Table Names step dialog and set the 'schema fieldname' to the incoming field that contains the schema name.
  2. If schemas should not be dynamic, disable the dynamic-schema option so the field is not required.
  3. In code, call meta.setSchemaFieldName("schemaField") before running the transformation.
  4. Add a preceding step that guarantees the schema-name field exists in the row stream.

Example fix

// before: running with empty schema field
GetTableNamesMeta meta = (GetTableNamesMeta) stepMeta.getStepMetaInterface();
meta.setDynamicSchema( true ); // schemaFieldName left null
// after
GetTableNamesMeta meta = (GetTableNamesMeta) stepMeta.getStepMetaInterface();
meta.setDynamicSchema( true );
meta.setSchemaFieldName( "schema_name" ); // must match an incoming field
Defensive patterns

Strategy: validation

Validate before calling

if ( meta.isDynamicSchema() && Utils.isEmpty( meta.getSchemaFieldName() ) ) {
  throw new IllegalArgumentException( "schemaFieldName must be set for dynamic schema" );
}

Try / catch

try {
  trans.execute( null );
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "NoSchemaField" ) ) {
    logError( "Configure the schema fieldname in the Get Table Names step" );
  }
}

Prevention

When it happens

Trigger: Executing a transformation whose GetTableNames step has a dynamic schema lookup enabled (or expects input-driven schema) but the 'schema fieldname' property was never filled in the step dialog, so meta.getSchemaFieldName() returns empty at processRow.

Common situations: Step copied from another transformation without reconfiguration; transformation built programmatically where setSchemaFieldName was never called; upgrading an old .ktr where the field name was lost.

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


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/bef11b806936e38c. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/gettablenames/GetTableNames.java:88

      if ( data.readrow == null ) {
        setOutputDone();
        return false;
      }
    }

    if ( first ) {
      first = false;

      if ( meta.isDynamicSchema() ) {
        data.inputRowMeta = getInputRowMeta();
        data.outputRowMeta = data.inputRowMeta.clone();
        // Get total previous fields
        data.totalpreviousfields = data.inputRowMeta.size();

        // Check is filename field is provided
        if ( Utils.isEmpty( meta.getSchemaFieldName() ) ) {
          logError( BaseMessages.getString( PKG, "GetTableNames.Log.NoSchemaField" ) );
          throw new KettleException( BaseMessages.getString( PKG, "GetTableNames.Log.NoSchemaField" ) );
        }

        // cache the position of the field
        if ( data.indexOfSchemaField < 0 ) {
          data.indexOfSchemaField = data.inputRowMeta.indexOfValue( meta.getSchemaFieldName() );
          if ( data.indexOfSchemaField < 0 ) {
            // The field is unreachable !
            logError( BaseMessages.getString( PKG, "GetTableNames.Log.ErrorFindingField" )
              + "[" + meta.getSchemaFieldName() + "]" );
            throw new KettleException( BaseMessages.getString(
              PKG, "GetTableNames.Exception.CouldnotFindField", meta.getSchemaFieldName() ) );
          }
        }

      } else {
        data.outputRowMeta = new RowMeta();
      }

View on GitHub (pinned to f3058517a1)