apache/iceberg · error · UnsupportedOperationException

Deleting data and delete files is not supported

Error message

Deleting data and delete files is not supported

What it means

Default-method guard in OverwriteFiles: the deleteFiles(DataFileSet, DeleteFileSet) overload for jointly deleting data files and their associated delete files is not implemented by this table's overwrite operation. It fires when a caller uses the paired-set deletion API on an implementation that only supports single-file deletes — a capability gap, not a data problem.

Solutions

  1. Delete files one by one with deleteFile(DataFile) / deleteFile(DeleteFile) instead
  2. Catch UnsupportedOperationException and surface that batched paired deletion is unsupported
  3. Upgrade to an implementation that overrides deleteFiles
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at api/src/main/java/org/apache/iceberg/OverwriteFiles.java:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at api/src/main/java/org/apache/iceberg/OverwriteFiles.java:90

  /**
   * Delete a {@link DataFile} from the table.
   *
   * @param file a data file
   * @return this for method chaining
   */
  OverwriteFiles deleteFile(DataFile file);

  /**
   * Deletes a set of data files from the table with their respective delete files.
   *
   * @param dataFilesToDelete the data files to be deleted from the table
   * @param deleteFilesToDelete the delete files corresponding to the data files to be deleted from
   *     the table
   * @return this for method chaining
   */
  default OverwriteFiles deleteFiles(
      DataFileSet dataFilesToDelete, DeleteFileSet deleteFilesToDelete) {
    throw new UnsupportedOperationException("Deleting data and delete files is not supported");
  }

  /**
   * Signal that each file added to the table must match the overwrite expression.
   *
   * <p>If this method is called, each added file is validated on commit to ensure that it matches
   * the overwrite row filter. This is used to ensure that writes are idempotent: that files cannot
   * be added during a commit that would not be removed if the operation were run a second time.
   *
   * @return this for method chaining
   */
  OverwriteFiles validateAddedFilesMatchOverwriteFilter();

  /**
   * Set the snapshot ID used in any reads for this operation.
   *
   * <p>Validations will check changes after this snapshot ID. If the from snapshot is not set, all
   * ancestor snapshots through the table's initial snapshot are validated.

View on GitHub (pinned to 86d9c8fc54)