apache/iceberg · error · UnsupportedOperationException

Setting executor service is not supported

Error message

Setting executor service is not supported

What it means

SnapshotTable.executeWith(ExecutorService) is a default interface method that throws UnsupportedOperationException. Implementations that cannot accept a caller-provided executor keep the stub, so requesting custom parallelism for a snapshot (import) of a foreign table into Iceberg is rejected.

Source

Thrown at api/src/main/java/org/apache/iceberg/actions/SnapshotTable.java:69

  /**
   * Sets a table property in the newly created Iceberg table. Any properties with the same key name
   * will be overwritten.
   *
   * @param key the key of the property to add
   * @param value the value of the property to add
   * @return this for method chaining
   */
  SnapshotTable tableProperty(String key, String value);

  /**
   * Sets the executor service to use for parallel file reading. The default is not using executor
   * service.
   *
   * @param service executor service
   * @return this for method chaining
   */
  default SnapshotTable executeWith(ExecutorService service) {
    throw new UnsupportedOperationException("Setting executor service is not supported");
  }

  /**
   * Enables ignoring {@link java.io.FileNotFoundException} when listing source data files. When
   * enabled, source data files that have disappeared (for example, because a partition directory
   * was removed by concurrent cleanup) are skipped with a warning instead of failing the snapshot.
   * The default is to fail.
   *
   * @return this for method chaining
   */
  default SnapshotTable ignoreMissingFiles() {
    throw new UnsupportedOperationException("Ignoring missing files is not supported");
  }

  /** The action result that contains a summary of the execution. */
  interface Result {
    /** Returns the number of imported data files. */
    long importedDataFilesCount();

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Remove the executeWith(...) call and rely on the implementation's default execution
  2. Use an implementation that supports custom executors (e.g. Spark's SnapshotTable)
  3. Tune parallelism through implementation-supported configuration properties instead
  4. Catch UnsupportedOperationException and retry without the executor configuration

Example fix

// before
SnapshotTable.Result r = actions.snapshotTable(sourceTable)
    .executeWith(executorService)
    .execute();
// after
SnapshotTable.Result r = actions.snapshotTable(sourceTable)
    .execute(); // default execution
Defensive patterns

Strategy: try-catch

Try / catch

try {
  builder.executeWith(executorService);
} catch (UnsupportedOperationException e) {
  // proceed with default snapshot execution
}

Prevention

When it happens

Trigger: Calling snapshotTable(...).executeWith(executorService) on an implementation that has not overridden the default method; the RAISED-IN note shows it is also reached via the action's call() path when the executor is set through configuration.

Common situations: Users tuning Hive-to-Iceberg imports copied from Spark examples supply an ExecutorService on a binding that runs snapshots single-threaded and get the stub's exception during action setup or execution.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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