apache/iceberg · error · UnsupportedOperationException

this.getClass().getName() + " does not implement removeDangl

Error message

this.getClass().getName() + " does not implement removeDanglingDeleteFiles"

What it means

The default removeDanglingDeleteFiles factory method in ActionsProvider throws UnsupportedOperationException when the concrete provider does not implement it. This action removes delete files no longer referenced by the current snapshot; providers without the implementation reject the call.

Source

Thrown at api/src/main/java/org/apache/iceberg/actions/ActionsProvider.java:94

    throw new UnsupportedOperationException(
        this.getClass().getName() + " does not implement computeTableStats");
  }

  /** Instantiates an action to compute partition stats. */
  default ComputePartitionStats computePartitionStats(Table table) {
    throw new UnsupportedOperationException(
        this.getClass().getName() + " does not implement computePartitionStats");
  }

  /** Instantiates an action to rewrite all absolute paths in table metadata. */
  default RewriteTablePath rewriteTablePath(Table table) {
    throw new UnsupportedOperationException(
        this.getClass().getName() + " does not implement rewriteTablePath");
  }

  /** Instantiates an action to remove dangling delete files from current snapshot. */
  default RemoveDanglingDeleteFiles removeDanglingDeleteFiles(Table table) {
    throw new UnsupportedOperationException(
        this.getClass().getName() + " does not implement removeDanglingDeleteFiles");
  }

  /** Instantiates an action to repair a table. */
  default RepairTable repairTable(Table table) {
    throw new UnsupportedOperationException(
        this.getClass().getName() + " does not implement repairTable");
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Use a fully implemented provider (e.g., SparkActions.get(table)) that overrides removeDanglingDeleteFiles.
  2. Upgrade the engine integration module to a version implementing the action.
  3. Override removeDanglingDeleteFiles in your custom ActionsProvider implementation.

Example fix

// before
RemoveDanglingDeleteFiles a = customProvider.removeDanglingDeleteFiles(table);
// after
RemoveDanglingDeleteFiles a = SparkActions.get(table).removeDanglingDeleteFiles();
Defensive patterns

Strategy: try-catch

Validate before calling

boolean ok = Arrays.stream(provider.getClass().getMethods()).anyMatch(m -> "removeDanglingDeleteFiles".equals(m.getName()) && m.getDeclaringClass() != ActionsProvider.class);

Type guard

boolean implemented = provider.getClass() != ActionsProvider.class;

Try / catch

try { provider.removeDanglingDeleteFiles(table); } catch (UnsupportedOperationException e) { useAlternativeCleanup(table); }

Prevention

When it happens

Trigger: Calling removeDanglingDeleteFiles(table) on a provider that has not overridden the default method, such as a minimal custom ActionsProvider or an older engine binding.

Common situations: Maintenance jobs run against a provider lacking this action; version skew between the Iceberg API and the engine integration dependency.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/1e68a1391f7003c8. Report an issue: GitHub.