{"record":{"id":"4361c433bb9b2013","repo":"apache/iceberg","slug":"ignoring-missing-files-is-not-supported-4361c4","errorCode":null,"errorMessage":"Ignoring missing files is not supported","messagePattern":"Ignoring missing files is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/actions/SnapshotTable.java","lineNumber":81,"sourceCode":"   * 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();\n  }\n}\n","sourceCodeStart":63,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/actions/SnapshotTable.java#L63-L90","documentation":"SnapshotTable.ignoreMissingFiles() is a default interface method on the API module that throws UnsupportedOperationException. It signals that the action implementation (a catalog-specific or custom SnapshotTable) does not support skipping data files that disappeared between planning and execution; the default is to fail the snapshot when files are missing. Only implementations that explicitly override this method support lenient behavior.","triggerScenarios":"Calling snapshotTable().ignoreMissingFiles() on an implementation that has not overridden the default method, e.g. a custom action or a catalog whose SnapshotTable action does not support the option.","commonSituations":"Using a catalog connector (e.g. JDBC, Hive, Nessie builds) whose staged snapshot action predates or omits the ignoreMissingFiles capability; running snapshot import while files were deleted by concurrent cleanup and expecting a warning instead of a hard failure.","solutions":["Remove the ignoreMissingFiles() call so the action uses the default fail-on-missing-files behavior","Upgrade to a catalog/action implementation that overrides ignoreMissingFiles()","Implement ignoreMissingFiles() in the custom SnapshotTable action to set the skip-missing-files flag","Ensure concurrent cleanup (expireSnapshots/orphan file removal) is not racing the snapshot import"],"exampleFix":"// before\nSnapshotTable action = actions.snapshotTable(sourceTable, destIdent).ignoreMissingFiles();\n// after\n// Only call ignoreMissingFiles if the implementation supports it:\nSnapshotTable action = actions.snapshotTable(sourceTable, destIdent);\nif (action.supportsIgnoreMissingFiles()) { // or use an upgraded impl\n  action = action.ignoreMissingFiles();\n}","handlingStrategy":"try-catch","validationCode":"if (action.getClass().equals(SnapshotTable.class) /* default impl */) {\n  throw new IllegalStateException(\"This SnapshotTable does not support ignoreMissingFiles\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  action.ignoreMissingFiles();\n} catch (UnsupportedOperationException e) {\n  // proceed without lenient missing-file handling or switch implementation\n  LOG.warn(\"ignoreMissingFiles unsupported: {}\", e.getMessage());\n}","preventionTips":["Check the concrete action class documentation for ignoreMissingFiles support before enabling","Avoid racing file cleanup jobs (expireSnapshots, removeOrphanFiles) with snapshot imports","Pin to catalog versions known to implement the option","Write a startup capability check test for the action implementation"],"tags":["java","unsupported-operation","api-default-method","snapshot-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-14T11:17:12.474Z"}