apache/iceberg · warning · UnsupportedOperationException

does not support table invalidation

Error message

${CLASS_NAME} does not support table invalidation

What it means

SparkRewriteTableCatalog.invalidateTable always throws UnsupportedOperationException because its table source is an in-memory procedure cache with nothing to invalidate. The operation is intentionally unavailable on this catalog type.

Solutions

  1. Do not invalidate tables through the rewrite catalog; it holds procedure-scoped state only
  2. Let the rewrite procedure manage cache lifetimes
  3. Use SparkCatalog.invalidateTable on the real catalog if you need cache invalidation

Example fix

// before
rewriteCatalog.invalidateTable(ident)
// after
sparkCatalog.invalidateTable(ident) // on the standard Iceberg catalog binding
Defensive patterns

Strategy: try-catch

Validate before calling

if (catalog.isInstanceOf[SparkRewriteTableCatalog]) { /* skip invalidate */ }

Try / catch

try {
  catalog.invalidateTable(ident)
} catch {
  case _: UnsupportedOperationException => () // no-op for rewrite catalogs
}

Prevention

When it happens

Trigger: Calling invalidateTable(ident) on a SparkRewriteTableCatalog instance, typically from framework code refreshing cached table metadata.

Common situations: Spark engine cache invalidation paths invoked mid-procedure; user code holding a rewrite catalog handle and attempting a refresh.

Related errors


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

Appendix: source

Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/SparkRewriteTableCatalog.java:73

      throw new NoSuchTableException(ident);
    }

    return new SparkRewriteTable(table, groupId);
  }

  @Override
  public SparkTable loadTable(Identifier ident, String version) throws NoSuchTableException {
    throw new UnsupportedOperationException(CLASS_NAME + " does not support time travel");
  }

  @Override
  public SparkTable loadTable(Identifier ident, long timestampMicros) throws NoSuchTableException {
    throw new UnsupportedOperationException(CLASS_NAME + " does not support time travel");
  }

  @Override
  public void invalidateTable(Identifier ident) {
    throw new UnsupportedOperationException(CLASS_NAME + " does not support table invalidation");
  }

  @Override
  public SparkTable createTable(
      Identifier ident, StructType schema, Transform[] partitions, Map<String, String> properties)
      throws TableAlreadyExistsException {
    throw new UnsupportedOperationException(CLASS_NAME + " does not support creating tables");
  }

  @Override
  public SparkTable alterTable(Identifier ident, TableChange... changes) {
    throw new UnsupportedOperationException(CLASS_NAME + " does not support altering tables");
  }

  @Override
  public boolean dropTable(Identifier ident) {
    throw new UnsupportedOperationException(CLASS_NAME + " does not support dropping tables");
  }

View on GitHub (pinned to 86d9c8fc54)