{"record":{"id":"f859b6faab5fc601","repo":"apache/iceberg","slug":"dropping-a-backup-is-not-supported","errorCode":null,"errorMessage":"Dropping a backup is not supported","messagePattern":"Dropping a backup is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/actions/MigrateTable.java","lineNumber":51,"sourceCode":"  MigrateTable tableProperties(Map<String, String> properties);\n\n  /**\n   * Sets a table property in the newly created Iceberg table. Any properties with the same key will\n   * be overwritten.\n   *\n   * @param name a table property name\n   * @param value a table property value\n   * @return this for method chaining\n   */\n  MigrateTable tableProperty(String name, String value);\n\n  /**\n   * Drops the backup of the original table after a successful migration\n   *\n   * @return this for method chaining\n   */\n  default MigrateTable dropBackup() {\n    throw new UnsupportedOperationException(\"Dropping a backup is not supported\");\n  }\n\n  /**\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","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/actions/MigrateTable.java#L33-L69","documentation":"MigrateTable's default dropBackup() method throws UnsupportedOperationException when the action implementation does not support dropping the backup of the original table after a successful migration. Migration backups keep the source table accessible; not all implementations allow programmatic backup removal.","triggerScenarios":"Calling migrateTable(...).dropBackup() on an implementation that has not overridden the method — e.g., older engine runtimes or custom MigrateTable actions.","commonSituations":"Automating migration cleanup (removing the backup table of the pre-migration source) with a runtime lacking support; following newer documentation against an older Iceberg version.","solutions":["Upgrade the engine integration to a version whose MigrateTable implementation supports dropBackup.","Drop the backup manually via the catalog (e.g., catalog.dropTable(backupTableName)) instead of using dropBackup().","Override dropBackup in a custom MigrateTable implementation."],"exampleFix":"// before\nMigrateTable m = SparkActions.get().migrateTable(table).dropBackup(); // throws on old impl\n// after (manual cleanup via catalog)\nSparkActions.get().migrateTable(table).execute();\ncatalog.dropTable(backupIdent);","handlingStrategy":"try-catch","validationCode":"boolean ok = Arrays.stream(migrate.getClass().getMethods()).anyMatch(m -> \"dropBackup\".equals(m.getName()) && m.getDeclaringClass() != MigrateTable.class);","typeGuard":"boolean implemented = migrate.getClass() != MigrateTable.class;","tryCatchPattern":"try { migrate = migrate.dropBackup(); } catch (UnsupportedOperationException e) { catalog.dropTable(backupIdent); }","preventionTips":["Upgrade engine integration if programmatic backup removal is required","Fall back to catalog.dropTable on the backup identifier","Decide the backup retention policy before migrating"],"tags":["java","iceberg","unsupported-operation","table-migration"],"backgroundTag":"method-not-implemented","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"}