{"record":{"id":"81f49947c3e71f93","repo":"apache/iceberg","slug":"cannot-update-the-properties-of-a-s-table","errorCode":null,"errorMessage":"Cannot update the properties of a %s table","messagePattern":"Cannot update the properties of a (.+?) table","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/BaseReadOnlyTable.java","lineNumber":43,"sourceCode":"  BaseReadOnlyTable(String descriptor) {\n    this.descriptor = descriptor;\n  }\n\n  @Override\n  public UpdateSchema updateSchema() {\n    throw new UnsupportedOperationException(\n        \"Cannot update the schema of a \" + descriptor + \" table\");\n  }\n\n  @Override\n  public UpdatePartitionSpec updateSpec() {\n    throw new UnsupportedOperationException(\n        \"Cannot update the partition spec of a \" + descriptor + \" table\");\n  }\n\n  @Override\n  public UpdateProperties updateProperties() {\n    throw new UnsupportedOperationException(\n        \"Cannot update the properties of a \" + descriptor + \" table\");\n  }\n\n  @Override\n  public ReplaceSortOrder replaceSortOrder() {\n    throw new UnsupportedOperationException(\n        \"Cannot update the sort order of a \" + descriptor + \" table\");\n  }\n\n  @Override\n  public UpdateLocation updateLocation() {\n    throw new UnsupportedOperationException(\n        \"Cannot update the location of a \" + descriptor + \" table\");\n  }\n\n  @Override\n  public AppendFiles newAppend() {\n    throw new UnsupportedOperationException(\"Cannot append to a \" + descriptor + \" table\");","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/BaseReadOnlyTable.java#L25-L61","documentation":"Iceberg throws this UnsupportedOperationException when updateProperties() is called on a read-only table. Setting table properties writes table metadata, which BaseReadOnlyTable subclasses deliberately reject. The descriptor names the read-only table kind in the message.","triggerScenarios":"Calling table.updateProperties().set(...) on a metadata table (e.g. table.snapshots()) or any other BaseReadOnlyTable subclass instance.","commonSituations":"Configuration automation that applies property sets to any Table it finds, including metadata tables obtained from table.metadataTableReferences() or direct snapshots()/files() references.","solutions":["Apply the property update on the writable data table loaded via catalog.loadTable(identifier).","Filter out metadata tables before running generic property-update code.","If properties only need to be read, use table.properties()."],"exampleFix":"// before\ntable.files().updateProperties().set(\"write.format.default\", \"parquet\").commit();\n\n// after\nTable dataTable = catalog.loadTable(TableIdentifier.of(\"db\", \"tbl\"));\ndataTable.updateProperties().set(\"write.format.default\", \"parquet\").commit();","handlingStrategy":"try-catch","validationCode":"if (table.name().contains(\".\")) {\n  // metadata tables are named like \"table.snapshots\"; base tables are not dotted\n  throw new IllegalArgumentException(\"Refusing to set properties on: \" + table.name());\n}","typeGuard":"boolean isMetadataTable = table.name().lastIndexOf('.') > 0; // metadata tables carry dotted names","tryCatchPattern":"try {\n  table.updateProperties().set(key, value).commit();\n} catch (UnsupportedOperationException e) {\n  log.error(\"Cannot set properties on read-only table {}\", table.name(), e);\n}","preventionTips":["Only pass catalog-loaded Table objects to property-update utilities.","Reject dotted (metadata) table names in config automation.","Read properties via table.properties() when no write is intended."],"tags":["unsupported-operation","table-properties","read-only-table"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}