{"record":{"id":"e3a7c57fc061c07b","repo":"apache/iceberg","slug":"operation-updatepartitionstatistics-is-not-support","errorCode":null,"errorMessage":"Operation updatePartitionStatistics is not supported after the table is serialized","messagePattern":"Operation updatePartitionStatistics is not supported after the table is serialized","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/SerializableTable.java","lineNumber":417,"sourceCode":"\n  @Override\n  public ReplacePartitions newReplacePartitions() {\n    throw new UnsupportedOperationException(errorMsg(\"newReplacePartitions\"));\n  }\n\n  @Override\n  public DeleteFiles newDelete() {\n    throw new UnsupportedOperationException(errorMsg(\"newDelete\"));\n  }\n\n  @Override\n  public UpdateStatistics updateStatistics() {\n    throw new UnsupportedOperationException(errorMsg(\"updateStatistics\"));\n  }\n\n  @Override\n  public UpdatePartitionStatistics updatePartitionStatistics() {\n    throw new UnsupportedOperationException(errorMsg(\"updatePartitionStatistics\"));\n  }\n\n  @Override\n  public ExpireSnapshots expireSnapshots() {\n    throw new UnsupportedOperationException(errorMsg(\"expireSnapshots\"));\n  }\n\n  @Override\n  public ManageSnapshots manageSnapshots() {\n    throw new UnsupportedOperationException(errorMsg(\"manageSnapshots\"));\n  }\n\n  @Override\n  public Transaction newTransaction() {\n    throw new UnsupportedOperationException(errorMsg(\"newTransaction\"));\n  }\n\n  @Override","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SerializableTable.java#L399-L435","documentation":"SerializableTable carries only table metadata and FileIO for distributed reads; it cannot commit metadata because serialization drops the catalog connection. updatePartitionStatistics() is a committing operation, so SerializableTable overrides it to throw UnsupportedOperationException with this message. Partition statistics must be published through a live, catalog-backed Table.","triggerScenarios":"Calling table.updatePartitionStatistics() on a deserialized SerializableTable inside a worker task, e.g. computing partition stats in executors and attempting to commit them there.","commonSituations":"Distributed partition-stats maintenance jobs; utilities that accept a generic Table and receive a SerializableTable; code refactored from driver into executor scope.","solutions":["Publish partition statistics with catalog.loadTable(id).updatePartitionStatistics()...commit()","Gather stats on workers and perform the commit driver-side with the original Table","Use engine-native maintenance commands instead of manual partition-stat commits on executors","Add an instanceof SerializableTable check before any committing operation to fail fast"],"exampleFix":"// before\nTable table = serialized;\ntable.updatePartitionStatistics().setPartitionStatistics(partitionStatsFile).commit();\n// after\nTable table = catalog.loadTable(identifier);\ntable.updatePartitionStatistics().setPartitionStatistics(partitionStatsFile).commit();","handlingStrategy":"try-catch","validationCode":"if (table instanceof org.apache.iceberg.SerializableTable) {\n  throw new IllegalStateException(\"updatePartitionStatistics() requires a catalog-backed Table\");\n}","typeGuard":"boolean canUpdatePartitionStats = !(table instanceof org.apache.iceberg.SerializableTable);","tryCatchPattern":"try {\n  table.updatePartitionStatistics().setPartitionStatistics(psf).commit();\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"not supported after the table is serialized\")) {\n    catalog.loadTable(identifier).updatePartitionStatistics().setPartitionStatistics(psf).commit();\n  } else { throw e; }\n}","preventionTips":["Publish partition statistics only through a catalog-backed Table","Gather per-partition stats in workers and commit centrally","Keep SerializableTable usage limited to scans/reads","Fail fast with instanceof SerializableTable checks before committing"],"tags":["java","iceberg","unsupported-operation","serialization"],"backgroundTag":"unsupported-operation","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"}