pentaho/pentaho-kettle · error · KettleDependencyException

This partition schema is still in use by one or more…

Error message

This partition schema is still in use by one or more transformations ({0}) :

What it means

delPartitionSchema throws KettleDependencyException when the partition schema is still referenced by one or more transformations. Deleting it would break those transformations, so the repository refuses and lists the dependent transformation names in the message.

Solutions

  1. Re-point or update the listed transformations to another partition schema, then delete
  2. Delete/retire the dependent transformations first if they are obsolete
  3. If deletion is truly intended, remove the dependency rows via the repository API deliberately
  4. Catch KettleDependencyException and report the dependent transformation list to the user

Example fix

// before
delegate.delPartitionSchema(schemaId);
// after
try {
  delegate.delPartitionSchema(schemaId);
} catch (KettleDependencyException e) {
  log.warn("Schema in use: " + e.getMessage() + " — update dependents first");
  // re-point transformations, then retry deletion
}
Defensive patterns

Strategy: try-catch

Validate before calling

// before deleting, check dependencies via repository lookups of transformation->partition schema mappings

Try / catch

try { delegate.delPartitionSchema(id); } catch (KettleDependencyException e) { log.warn("Dependent transformations: " + e.getMessage()); /* re-point or delete dependents first */ }

Prevention

When it happens

Trigger: Calling delPartitionSchema(id) while rows exist in the transformation partition schema mapping table referencing that ID (transList.length > 0).

Common situations: Cleanup scripts deleting shared partitioning configs still used by production transformations; deleting a schema from a repo shared by multiple teams; stale transformations that were never re-pointed after a refactor.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryPartitionSchemaDelegate.java:228

      repository.connectionDelegate.performDelete( "DELETE FROM "
        + quoteTable( KettleDatabaseRepository.TABLE_R_PARTITION ) + " WHERE "
        + quote( KettleDatabaseRepository.FIELD_PARTITION_ID_PARTITION_SCHEMA ) + " = ? ", id_partition_schema );
      repository.connectionDelegate.performDelete(
        "DELETE FROM "
          + quoteTable( KettleDatabaseRepository.TABLE_R_PARTITION_SCHEMA ) + " WHERE "
          + quote( KettleDatabaseRepository.FIELD_PARTITION_SCHEMA_ID_PARTITION_SCHEMA ) + " = ? ",
        id_partition_schema );
    } else {
      StringBuilder message = new StringBuilder( 100 );

      message.append( "The partition schema is used by the following transformations:" ).append( Const.CR );
      for ( int i = 0; i < transList.length; i++ ) {
        message.append( "  " ).append( transList[i] ).append( Const.CR );
      }
      message.append( Const.CR );

      KettleDependencyException e = new KettleDependencyException( message.toString() );
      throw new KettleDependencyException(
        "This partition schema is still in use by one or more transformations (" + transList.length + ") :", e );
    }
  }
}

View on GitHub (pinned to f3058517a1)