{"record":{"id":"f90b660cba9607fd","repo":"apache/iceberg","slug":"class-name-does-not-support-table-invalidation","errorCode":null,"errorMessage":"${CLASS_NAME} does not support table invalidation","messagePattern":"(.+?) does not support table invalidation","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/SparkRewriteTableCatalog.java","lineNumber":73,"sourceCode":"      throw new NoSuchTableException(ident);\n    }\n\n    return new SparkRewriteTable(table, groupId);\n  }\n\n  @Override\n  public SparkTable loadTable(Identifier ident, String version) throws NoSuchTableException {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support time travel\");\n  }\n\n  @Override\n  public SparkTable loadTable(Identifier ident, long timestampMicros) throws NoSuchTableException {\n    throw new UnsupportedOperationException(CLASS_NAME + \" does not support time travel\");\n  }\n\n  @Override\n  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  }","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/SparkRewriteTableCatalog.java#L55-L91","documentation":"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.","triggerScenarios":"Calling invalidateTable(ident) on a SparkRewriteTableCatalog instance, typically from framework code refreshing cached table metadata.","commonSituations":"Spark engine cache invalidation paths invoked mid-procedure; user code holding a rewrite catalog handle and attempting a refresh.","solutions":["Do not invalidate tables through the rewrite catalog; it holds procedure-scoped state only","Let the rewrite procedure manage cache lifetimes","Use SparkCatalog.invalidateTable on the real catalog if you need cache invalidation"],"exampleFix":"// before\nrewriteCatalog.invalidateTable(ident)\n// after\nsparkCatalog.invalidateTable(ident) // on the standard Iceberg catalog binding","handlingStrategy":"try-catch","validationCode":"if (catalog.isInstanceOf[SparkRewriteTableCatalog]) { /* skip invalidate */ }","typeGuard":null,"tryCatchPattern":"try {\n  catalog.invalidateTable(ident)\n} catch {\n  case _: UnsupportedOperationException => () // no-op for rewrite catalogs\n}","preventionTips":["Skip cache invalidation on procedure-scoped catalogs","Let rewrite procedures manage their own cache","Call invalidateTable only on SparkCatalog instances"],"tags":["spark","catalog","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"}