apache/iceberg · error · UnsupportedOperationException

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

Error message

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

What it means

The default repairTable factory method in ActionsProvider throws UnsupportedOperationException when the concrete provider does not implement it. RepairTable fixes corrupt table metadata (e.g., recovering from the metadata.json history); providers that don't support it throw at call time.

Source

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

    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. Invoke repairTable via a provider that implements it (e.g., SparkActions.get(table)).
  2. Upgrade the engine integration module to a version implementing repairTable.
  3. Override repairTable in your custom ActionsProvider to return a concrete RepairTable action.

Example fix

// before
RepairTable a = customProvider.repairTable(table);
// after
RepairTable a = SparkActions.get(table).repairTable();
Defensive patterns

Strategy: try-catch

Validate before calling

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

Type guard

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

Try / catch

try { provider.repairTable(table); } catch (UnsupportedOperationException e) { throw new IllegalStateException("repairTable not available in this runtime", e); }

Prevention

When it happens

Trigger: Calling repairTable(table) on an ActionsProvider without the override — custom providers, minimal test providers, or engine runtimes that never implemented table repair.

Common situations: Attempted metadata repair in an environment where the repair action is unavailable; provider implementations not updated alongside the API.

Related errors


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