{"record":{"id":"0dd2d1a5e5d22c9c","repo":"apache/iceberg","slug":"does-not-support-dropping-tables","errorCode":null,"errorMessage":" does not support dropping tables","messagePattern":" does not support dropping tables","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/SparkCachedTableCatalog.java","lineNumber":108,"sourceCode":"  public void invalidateTable(Identifier ident) {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support table invalidation\");\n  }\n\n  @Override\n  public SparkTable createTable(\n      Identifier ident, StructType schema, Transform[] partitions, Map<String, String> properties)\n      throws TableAlreadyExistsException {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support creating tables\");\n  }\n\n  @Override\n  public SparkTable alterTable(Identifier ident, TableChange... changes) {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support altering tables\");\n  }\n\n  @Override\n  public boolean dropTable(Identifier ident) {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support dropping tables\");\n  }\n\n  @Override\n  public boolean purgeTable(Identifier ident) throws UnsupportedOperationException {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support purging tables\");\n  }\n\n  @Override\n  public void renameTable(Identifier oldIdent, Identifier newIdent) {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support renaming tables\");\n  }\n\n  @Override\n  public void initialize(String catalogName, CaseInsensitiveStringMap options) {\n    this.name = catalogName;\n  }\n\n  @Override","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/SparkCachedTableCatalog.java#L90-L126","documentation":"This UnsupportedOperationException is a deliberate guard in SparkCachedTableCatalog.dropTable: cached tables are read-only handles, so the catalog cannot remove the underlying Iceberg table from its parent catalog. DROP TABLE statements (with or without EXTERNAL/PURGE qualifiers) that Spark routes to this catalog raise this sentinel unconditionally and return no boolean result.","triggerScenarios":"Running DROP TABLE against a table identifier owned by the cached-table catalog.","commonSituations":"Cleanup scripts or test teardown that assume the catalog is a persistent Iceberg catalog.","solutions":["Drop the table through the owning Iceberg catalog (SparkCatalog)","Remove entries from SparkTableCache explicitly instead of dropping","Qualify DROP TABLE with the real catalog name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (catalog instanceof SparkCachedTableCatalog) {\n  throw new IllegalArgumentException(\"DROP TABLE not supported on cached catalog; use owning catalog\");\n}","typeGuard":null,"tryCatchPattern":"try { catalog.dropTable(ident); } catch (UnsupportedOperationException e) { realCatalog.dropTable(ident); }","preventionTips":["Exclude SparkCachedTableCatalog identifiers from drop/teardown tooling","Clean cache entries explicitly rather than dropping through this catalog"],"tags":["spark","catalog","ddl","unsupported-operation"],"backgroundTag":"operation-not-supported","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}