apache/iceberg · error · RuntimeException

Cannot perform rename for content type:

Error message

Cannot perform rename for content type: 

What it means

A plain RuntimeException thrown when validateFromContentForRename receives a Content.Type that is neither ICEBERG_VIEW nor ICEBERG_TABLE. This is an internal guard: the Nessie rename path only supports renaming Iceberg tables and views. It indicates an unsupported/unknown Nessie content type was passed to the rename flow.

Solutions

  1. Confirm the identifier actually refers to Iceberg content ( IcebergTable/IcebergView) via the Nessie API.
  2. Upgrade the Iceberg-nessie modules if the content type is a newly added Nessie content type.
  3. Rename non-Iceberg content with the appropriate tooling, not the Iceberg catalog.

Example fix

// before
catalog.renameTable(TableIdentifier.of("ns", "delta_thing"), TableIdentifier.of("ns", "renamed")); // content is Delta
// after
Content c = nessieApi.content().key(NessieUtil.toKey("ns", "delta_thing")).reference(ref).get().get(key);
if (c.getType() == Content.Type.ICEBERG_TABLE) {
  catalog.renameTable(TableIdentifier.of("ns", "delta_thing"), TableIdentifier.of("ns", "renamed"));
}
Defensive patterns

Strategy: type-guard

Validate before calling

Content c = nessieApi.content().key(key).reference(ref).get().get(key); boolean ok = c == null || c.getType() == Content.Type.ICEBERG_TABLE || c.getType() == Content.Type.ICEBERG_VIEW;

Type guard

boolean isIcebergContent(Content c) { return c != null && (c.getType() == Content.Type.ICEBERG_TABLE || c.getType() == Content.Type.ICEBERG_VIEW); }

Try / catch

try { renameContent(...); } catch (RuntimeException e) { if (e.getMessage().startsWith("Cannot perform rename")) { /* unsupported content type */ } else { throw e; } }

Prevention

When it happens

Trigger: renameContent invoked internally with a type other than ICEBERG_TABLE/ICEBERG_VIEW, e.g. when Nessie stores a new/unrecognized content kind (like DELTA or NAMESPACE) under the from identifier.

Common situations: A Nessie repo contains content written by a newer Nessie/other engine (e.g. Delta lake content) and an Iceberg rename is attempted on that identifier; internal misuse of NessieIcebergClient.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java:538

      } else if (existingToContent.getType() == Content.Type.ICEBERG_TABLE) {
        throw new AlreadyExistsException("Cannot rename %s to %s. Table already exists", from, to);
      } else {
        throw new AlreadyExistsException(
            "Cannot rename %s to %s. Another content of type %s with same name already exists",
            from, to, existingToContent.getType());
      }
    }
  }

  private static void validateFromContentForRename(
      TableIdentifier from, Content.Type type, IcebergContent existingFromContent) {
    if (existingFromContent == null) {
      if (type == Content.Type.ICEBERG_VIEW) {
        throw new NoSuchViewException("View does not exist: %s", from);
      } else if (type == Content.Type.ICEBERG_TABLE) {
        throw new NoSuchTableException("Table does not exist: %s", from);
      } else {
        throw new RuntimeException("Cannot perform rename for content type: " + type);
      }
    } else if (existingFromContent.getType() != type) {
      throw new RuntimeException(
          String.format("content type of from identifier %s should be of %s", from, type));
    }
  }

  public boolean dropTable(TableIdentifier identifier, boolean purge) {
    return dropContent(identifier, purge, Content.Type.ICEBERG_TABLE);
  }

  public boolean dropView(TableIdentifier identifier, boolean purge) {
    return dropContent(identifier, purge, Content.Type.ICEBERG_VIEW);
  }

  private boolean dropContent(TableIdentifier identifier, boolean purge, Content.Type type) {
    getRef().checkMutable();

View on GitHub (pinned to 86d9c8fc54)