apache/beam · error · java.lang.UnsupportedOperationException
SideInputTable is a read-only metadata adapter and does not…
Error message
SideInputTable is a read-only metadata adapter and does not support snapshots.
What it means
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.
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.
Example fix
// before Snapshot snap = sideInputTable.currentSnapshot(); // after Snapshot snap = preloadedTable.currentSnapshot(); // catalog-backed table
Defensive patterns
Strategy: type-guard
Type guard
boolean hasCurrentSnapshot = !(table instanceof SideInputTable);
Try / catch
try {
Snapshot s = table.currentSnapshot();
} catch (UnsupportedOperationException e) {
if (!e.getMessage().contains("does not support snapshots")) throw e;
// use the snapshot embedded in the SerializableTableSpec instead
} Prevention
- 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.
When it happens
Trigger: Calling table.currentSnapshot() on a SideInputTable deserialized inside a Beam worker.
Common situations: 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.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- SideInputTable is a read-only metadata adapter and does not…
- SideInputTable is a read-only metadata adapter and does not…
- SideInputTable is a read-only metadata adapter and does not…
- SideInputTable is a read-only metadata adapter and does not…
- SideInputTable is a read-only metadata adapter and does not…
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/985ff4ab6e609faf.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SideInputTable.java:183
@Override
public FileIO io() {
return spec.getFileIO();
}
@Override
public EncryptionManager encryption() {
return encryptionManager;
}
@Override
public void refresh() {
throw new UnsupportedOperationException(
"SideInputTable is a read-only metadata adapter and does not support refresh.");
}
@Override
public Snapshot currentSnapshot() {
throw new UnsupportedOperationException(
"SideInputTable is a read-only metadata adapter and does not support snapshots.");
}
@Override
public Snapshot snapshot(long snapshotId) {
throw new UnsupportedOperationException(
"SideInputTable is a read-only metadata adapter and does not support snapshots.");
}
@Override
public Iterable<Snapshot> snapshots() {
throw new UnsupportedOperationException(
"SideInputTable is a read-only metadata adapter and does not support snapshots.");
}
@Override
public List<HistoryEntry> history() {
throw new UnsupportedOperationException(View on GitHub (pinned to 12126d8942)