{"record":{"id":"d31de65633ca9208","repo":"apache/iceberg","slug":"setting-executor-service-is-not-supported-d31de6","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/SnapshotTable.java","lineNumber":69,"sourceCode":"  /**\n   * Sets a table property in the newly created Iceberg table. Any properties with the same key name\n   * will be overwritten.\n   *\n   * @param key the key of the property to add\n   * @param value the value of the property to add\n   * @return this for method chaining\n   */\n  SnapshotTable tableProperty(String key, String value);\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 SnapshotTable 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 snapshot.\n   * The default is to fail.\n   *\n   * @return this for method chaining\n   */\n  default SnapshotTable 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 imported data files. */\n    long importedDataFilesCount();","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/actions/SnapshotTable.java#L51-L87","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the executeWith(...) call and rely on the implementation's default execution","Use an implementation that supports custom executors (e.g. Spark's SnapshotTable)","Tune parallelism through implementation-supported configuration properties instead","Catch UnsupportedOperationException and retry without the executor configuration"],"exampleFix":"// before\nSnapshotTable.Result r = actions.snapshotTable(sourceTable)\n    .executeWith(executorService)\n    .execute();\n// after\nSnapshotTable.Result r = actions.snapshotTable(sourceTable)\n    .execute(); // default execution","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  builder.executeWith(executorService);\n} catch (UnsupportedOperationException e) {\n  // proceed with default snapshot execution\n}","preventionTips":["Do not copy executor tuning from Spark snapshot jobs onto other bindings","Verify each chained option is implemented by the concrete action class","Handle UnsupportedOperationException at configuration time so execute() never starts with wrong assumptions","Prefer implementation-specific configuration properties for parallelism control"],"tags":["unsupported-operation","java","executor-service","table-import"],"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"}