apache/iceberg · error · UnsupportedOperationException

this.getClass().getName() + " does not implement…

Error message

this.getClass().getName() + " does not implement equalAuthorities"

What it means

equalAuthorities(Map<String,String>) on DeleteOrphanFiles declares which URI authorities (e.g., different Kerberos servicenames or host aliases) should be considered equal when comparing file locations. The default throws UnsupportedOperationException when the action implementation does not support this configuration option.

Solutions

  1. Upgrade the engine integration to a version implementing equalAuthorities.
  2. Remove the equalAuthorities call if authorities already compare equal in your environment.
  3. Override equalAuthorities in a custom DeleteOrphanFiles implementation.

Example fix

// before
DeleteOrphanFiles a = action.equalAuthorities(Map.of("old-host", "new-host")); // throws
// after (after upgrading to a supporting implementation)
DeleteOrphanFiles a = action.equalAuthorities(Map.of("old-host", "new-host"));
Defensive patterns

Strategy: try-catch

Validate before calling

boolean ok = Arrays.stream(action.getClass().getMethods()).anyMatch(m -> "equalAuthorities".equals(m.getName()) && m.getDeclaringClass() != DeleteOrphanFiles.class);

Type guard

boolean implemented = action.getClass() != DeleteOrphanFiles.class;

Try / catch

try { action = action.equalAuthorities(authorityMap); } catch (UnsupportedOperationException e) { LOG.warn("equalAuthorities unsupported; using default comparison"); }

Prevention

When it happens

Trigger: Calling .equalAuthorities(map) on a DeleteOrphanFiles implementation lacking the override — e.g., an older engine runtime or a custom implementation of the action.

Common situations: Storage migrations where the same filesystem is reachable under different authorities; running new configuration code against an older Iceberg dependency.

Related errors


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

Appendix: source

Thrown at api/src/main/java/org/apache/iceberg/actions/DeleteOrphanFiles.java:137

   * @param newEqualSchemes list of equal schemes
   * @return this for method chaining
   */
  default DeleteOrphanFiles equalSchemes(Map<String, String> newEqualSchemes) {
    throw new UnsupportedOperationException(
        this.getClass().getName() + " does not implement equalSchemes");
  }

  /**
   * Passes authorities that should be considered equal.
   *
   * <p>The key may include a comma-separate list of authorities. For instance, Map("s1name,s2name",
   * "servicename").
   *
   * @param newEqualAuthorities list of equal authorities
   * @return this for method chaining
   */
  default DeleteOrphanFiles equalAuthorities(Map<String, String> newEqualAuthorities) {
    throw new UnsupportedOperationException(
        this.getClass().getName() + " does not implement equalAuthorities");
  }

  /** The action result that contains a summary of the execution. */
  interface Result {
    /** Returns locations of orphan files. */
    Iterable<String> orphanFileLocations();

    /** Returns the total number of orphan files. */
    default long orphanFilesCount() {
      return 0;
    }
  }

  /**
   * Defines the action behavior when location prefixes (scheme/authority) mismatch.
   *
   * <p>{@link #ERROR} - throw an exception. {@link #IGNORE} - no action. {@link #DELETE} - delete

View on GitHub (pinned to 86d9c8fc54)