pentaho/pentaho-kettle · error · KettleException

TableOutputMeta.Exception.TableNotSpecified

TableOutputMeta.Exception.TableNotSpecified

Error message

TableOutputMeta.Exception.TableNotSpecified

What it means

Thrown when the Table Output step's target table name resolves to empty/null after variable substitution. The step requires a concrete table name to look up field metadata; without one it cannot proceed, so it raises this keyed KettleException instead of the TableNotFound error.

Solutions

  1. Enter a table name in the Table Output dialog's Target table field.
  2. If using a variable, define it in the transformation/run configuration (kettle.properties, parameter, or setVariable) so it resolves to a non-empty value.
  3. Validate resolution at runtime with ${...} in a log/preview to confirm the value is non-empty.
  4. If the table name comes from a field, ensure the field is populated for the lookup path used.

Example fix

// before
String tableName = "${TARGET_TABLE}"; // TARGET_TABLE undefined -> resolves to ""
// after (define in kettle.properties or as run parameter)
TARGET_TABLE=customers
Defensive patterns

Strategy: validation

Validate before calling

// resolve and check table name before use
String real = meta.getTableName(); // substitute via VariableSpace in real code
String resolved = space.environmentSubstitute(real);
if (resolved == null || resolved.trim().isEmpty()) {
  throw new IllegalArgumentException("Table Output: target table name is empty");
}

Prevention

When it happens

Trigger: The code path where Utils.isEmpty(realTableName) is true — tableName (or the variable expression) resolves to an empty string when getTableFields()/getFields is invoked.

Common situations: Table name field left blank; a ${TABLE_NAME} variable is not defined in the runtime environment so it resolves to empty; using 'Insert table name defined in a field' but the table name field is not set when metadata lookup runs.

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


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputMeta.java:920

  public RowMetaInterface getRequiredFields( VariableSpace space ) throws KettleException {
    String realTableName = space.environmentSubstitute( tableName );
    String realSchemaName = space.environmentSubstitute( schemaName );

    if ( databaseMeta != null ) {
      Database db = new Database( loggingObject, databaseMeta );
      try {
        db.connect();

        if ( !Utils.isEmpty( realTableName ) ) {
          // Check if this table exists...
          if ( db.checkTableExists( realSchemaName, realTableName ) ) {
            return db.getTableFieldsMeta( realSchemaName, realTableName );
          } else {
            throw new KettleException( BaseMessages.getString( PKG, "TableOutputMeta.Exception.TableNotFound" ) );
          }
        } else {
          throw new KettleException( BaseMessages.getString( PKG, "TableOutputMeta.Exception.TableNotSpecified" ) );
        }
      } catch ( Exception e ) {
        throw new KettleException(
          BaseMessages.getString( PKG, "TableOutputMeta.Exception.ErrorGettingFields" ), e );
      } finally {
        db.close();
      }
    } else {
      throw new KettleException( BaseMessages.getString( PKG, "TableOutputMeta.Exception.ConnectionNotDefined" ) );
    }

  }

  public DatabaseMeta[] getUsedDatabaseConnections() {
    if ( databaseMeta != null ) {
      return new DatabaseMeta[] { databaseMeta };
    } else {
      return super.getUsedDatabaseConnections();

View on GitHub (pinned to f3058517a1)