apache/iceberg · error · UnsupportedOperationException
does not support purging tables
Error message
does not support purging tables
What it means
This UnsupportedOperationException is a deliberate guard in SparkCachedTableCatalog.purgeTable: purging means deleting a table plus all of its data/metadata files, which is a destructive operation on the backing Iceberg table that a cache-only catalog does not perform. Any DROP TABLE ... PURGE (or catalog purgeTable call) routed here hits this unconditional sentinel instead of touching storage.
Solutions
- Purge the table via the real Iceberg catalog
- Exclude cached-catalog tables from purge tooling
- Use expire_snapshots / purge procedures against the owning catalog instead
Defensive patterns
Strategy: validation
Validate before calling
if (catalog instanceof SparkCachedTableCatalog) {
throw new IllegalArgumentException("PURGE not supported on cached catalog; use owning catalog");
} Try / catch
try { catalog.purgeTable(ident); } catch (UnsupportedOperationException e) { realCatalog.purgeTable(ident); } Prevention
- Run purge procedures against the persistent catalog
- Filter lifecycle jobs to catalogs that support purging
When it happens
Trigger: Running DROP TABLE ... PURGE (or an engine call to purgeTable) on a table resolved via the cached-table catalog.
Common situations: Lifecycle-management jobs issuing PURGE against every table in a namespace, hitting this passthrough catalog.
Related errors
- Altering a view is not supported by catalog:
- Altering a view is not supported by catalog
- Altering a view is not supported by catalog
- Altering a view is not supported by catalog
- Cannot apply unknown table change
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/69a6c817dd20853e.
Report an issue: GitHub.
Appendix: source
Thrown at spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/SparkCachedTableCatalog.java:113
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");
}
@Override
public boolean purgeTable(Identifier ident) throws UnsupportedOperationException {
throw new UnsupportedOperationException(CLASS_NAME + " does not support purging tables");
}
@Override
public void renameTable(Identifier oldIdent, Identifier newIdent) {
throw new UnsupportedOperationException(CLASS_NAME + " does not support renaming tables");
}
@Override
public void initialize(String catalogName, CaseInsensitiveStringMap options) {
this.name = catalogName;
}
@Override
public String name() {
return name;
}
private SparkTable load(Identifier ident) throws NoSuchTableException {View on GitHub (pinned to 86d9c8fc54)