{"record":{"id":"985ff4ab6e609faf","repo":"apache/beam","slug":"sideinputtable-is-a-read-only-metadata-adapter-and-does-not-985ff4","errorCode":null,"errorMessage":"SideInputTable is a read-only metadata adapter and does not support snapshots.","messagePattern":"SideInputTable is a read-only metadata adapter and does not support snapshots\\.","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SideInputTable.java","lineNumber":183,"sourceCode":"  @Override\n  public FileIO io() {\n    return spec.getFileIO();\n  }\n\n  @Override\n  public EncryptionManager encryption() {\n    return encryptionManager;\n  }\n\n  @Override\n  public void refresh() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support refresh.\");\n  }\n\n  @Override\n  public Snapshot currentSnapshot() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support snapshots.\");\n  }\n\n  @Override\n  public Snapshot snapshot(long snapshotId) {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support snapshots.\");\n  }\n\n  @Override\n  public Iterable<Snapshot> snapshots() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support snapshots.\");\n  }\n\n  @Override\n  public List<HistoryEntry> history() {\n    throw new UnsupportedOperationException(","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SideInputTable.java#L165-L201","documentation":"SideInputTable wraps a frozen snapshot of Iceberg metadata for side-input use and deliberately rejects currentSnapshot(), since snapshot semantics require live metadata. Calling it throws UnsupportedOperationException. Use the snapshot captured at spec-creation time instead.","triggerScenarios":"Calling table.currentSnapshot() on a SideInputTable deserialized inside a Beam worker.","commonSituations":"Code shared between live catalog tables and side-input tables; analytics helpers that always read the current snapshot; incorrect assumption that the adapter behaves like a full table.","solutions":["Obtain the snapshot from SerializableTableSpec / the original metadata rather than currentSnapshot().","If the current snapshot is required, load the real table from the catalog instead of using SideInputTable.","Guard with instanceof SideInputTable before calling snapshot methods."],"exampleFix":"// before\nSnapshot snap = sideInputTable.currentSnapshot();\n\n// after\nSnapshot snap = preloadedTable.currentSnapshot(); // catalog-backed table","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean hasCurrentSnapshot = !(table instanceof SideInputTable);","tryCatchPattern":"try {\n  Snapshot s = table.currentSnapshot();\n} catch (UnsupportedOperationException e) {\n  if (!e.getMessage().contains(\"does not support snapshots\")) throw e;\n  // use the snapshot embedded in the SerializableTableSpec instead\n}","preventionTips":["Capture snapshot info before building the side input and pass it alongside the spec.","Avoid calling currentSnapshot() on Table references that may be side-input adapters.","Document in helpers which Table operations require a catalog-backed table."],"tags":["java","iceberg","beam","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}