{"record":{"id":"5e2f8d372624b491","repo":"apache/iceberg","slug":"setting-executor-service-is-not-supported","errorCode":null,"errorMessage":"Setting executor service is not supported","messagePattern":"Setting executor service is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/actions/MigrateTable.java","lineNumber":72,"sourceCode":"  /**\n   * Sets a table name for the backup of the original table.\n   *\n   * @param tableName the table name for backup\n   * @return this for method chaining\n   */\n  default MigrateTable backupTableName(String tableName) {\n    throw new UnsupportedOperationException(\"Backup table name cannot be specified\");\n  }\n\n  /**\n   * Sets the executor service to use for parallel file reading. The default is not using executor\n   * service.\n   *\n   * @param service executor service\n   * @return this for method chaining\n   */\n  default MigrateTable executeWith(ExecutorService service) {\n    throw new UnsupportedOperationException(\"Setting executor service is not supported\");\n  }\n\n  /**\n   * Enables ignoring {@link java.io.FileNotFoundException} when listing source data files. When\n   * enabled, source data files that have disappeared (for example, because a partition directory\n   * was removed by concurrent cleanup) are skipped with a warning instead of failing the migration.\n   * The default is to fail.\n   *\n   * @return this for method chaining\n   */\n  default MigrateTable ignoreMissingFiles() {\n    throw new UnsupportedOperationException(\"Ignoring missing files is not supported\");\n  }\n\n  /** The action result that contains a summary of the execution. */\n  interface Result {\n    /** Returns the number of migrated data files. */\n    long migratedDataFilesCount();","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/actions/MigrateTable.java#L54-L90","documentation":"MigrateTable.executeWith(ExecutorService) is a default interface method that throws UnsupportedOperationException. Implementations that cannot accept a caller-provided executor service keep the default stub, so requesting custom parallelism on such an implementation is rejected.","triggerScenarios":"Calling migrateTable.executeWith(executorService) on an implementation that has not overridden the default method, typically to parallelize manifest reading during migration.","commonSituations":"Developers copy tuning code written for SparkActions' MigrateTable onto a different engine or custom implementation that runs the migration single-threaded; the executor customization is unsupported there.","solutions":["Drop the executeWith(...) call and let the implementation use its default execution model","Switch to an implementation that supports custom executors (e.g. SparkMigrateTable)","Tune parallelism via implementation-supported properties instead of a supplied ExecutorService","Guard the call with an instanceof/capability check before configuring the executor"],"exampleFix":"// before\nMigrateTable.Result r = actions.migrateTable(table)\n    .executeWith(executorService)\n    .execute();\n// after\nMigrateTable.Result r = actions.migrateTable(table)\n    .execute(); // default execution","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  builder.executeWith(executorService);\n} catch (UnsupportedOperationException e) {\n  // fall back to default single-threaded execution\n}","preventionTips":["Only set a custom ExecutorService on implementations documented to support it","Never assume Spark-specific tuning options exist on other engine bindings","Wrap option chaining in helpers that degrade gracefully","Review the interface's default method bodies to see which options are stubs"],"tags":["unsupported-operation","java","executor-service","fluent-api"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}