apache/iceberg · error · UnsupportedOperationException

doesn't implement createBranch(String)

Error message

%s doesn't implement createBranch(String)

What it means

Default-interface guard in ManageSnapshots: thrown when createBranch(String) is invoked on a snapshot manager implementation that did not override the single-argument branch creation overload. The %s names the runtime class, so the caller can see which implementation lacks branch support; input arguments are irrelevant to the failure.

Solutions

  1. Use the two-argument createBranch(name, snapshotId) overload which implementations typically support
  2. Catch UnsupportedOperationException and report that branch operations are unsupported by this table
  3. Upgrade or fix the snapshot manager implementation to override createBranch(String)
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at api/src/main/java/org/apache/iceberg/ManageSnapshots.java:96 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/c25e75b6ace0a7fa. Report an issue: GitHub.

Appendix: source

Thrown at api/src/main/java/org/apache/iceberg/ManageSnapshots.java:96

   *
   * @param snapshotId a snapshotId whose changes to apply
   * @return this for method chaining
   * @throws IllegalArgumentException If the table has no snapshot with the given id
   * @throws DuplicateWAPCommitException In case of a WAP workflow and if the table has a duplicate
   *     commit with same wapId
   */
  ManageSnapshots cherrypick(long snapshotId);

  /**
   * Create a new branch. The branch will point to current snapshot if the current snapshot is not
   * NULL. Otherwise, the branch will point to a newly created empty snapshot.
   *
   * @param name branch name
   * @return this for method chaining
   * @throws IllegalArgumentException if a branch with the given name already exists
   */
  default ManageSnapshots createBranch(String name) {
    throw new UnsupportedOperationException(
        this.getClass().getName() + " doesn't implement createBranch(String)");
  }

  /**
   * Create a new branch pointing to the given snapshot id.
   *
   * @param name branch name
   * @param snapshotId id of the snapshot which will be the head of the branch
   * @return this for method chaining
   * @throws IllegalArgumentException if a branch with the given name already exists
   */
  ManageSnapshots createBranch(String name, long snapshotId);

  /**
   * Create a new tag pointing to the given snapshot id
   *
   * @param name tag name
   * @param snapshotId snapshotId for the head of the new tag.

View on GitHub (pinned to 86d9c8fc54)