{"record":{"id":"8dd2288fd97c48ba","repo":"apache/beam","slug":"sideinputtable-is-a-read-only-metadata-adapter-and-does-not-8dd228","errorCode":null,"errorMessage":"SideInputTable is a read-only metadata adapter and does not support scans directly.","messagePattern":"SideInputTable is a read-only metadata adapter and does not support scans directly\\.","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":225,"sourceCode":"    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support snapshot refs.\");\n  }\n\n  @Override\n  public List<StatisticsFile> statisticsFiles() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support statisticsFiles.\");\n  }\n\n  @Override\n  public List<PartitionStatisticsFile> partitionStatisticsFiles() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support partitionStatisticsFiles.\");\n  }\n\n  @Override\n  public TableScan newScan() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support scans directly.\");\n  }\n\n  @Override\n  public IncrementalAppendScan newIncrementalAppendScan() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support scans directly.\");\n  }\n\n  @Override\n  public IncrementalChangelogScan newIncrementalChangelogScan() {\n    throw new UnsupportedOperationException(\n        \"SideInputTable is a read-only metadata adapter and does not support scans directly.\");\n  }\n\n  @Override\n  public UpdateSchema updateSchema() {\n    throw new UnsupportedOperationException(","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SideInputTable.java#L207-L243","documentation":"SideInputTable.newScan() throws UnsupportedOperationException: the adapter does not support direct table scans. In Beam's Iceberg IO, reading is performed via the IO transforms using the pre-planned data files in the spec, not via Iceberg TableScan.","triggerScenarios":"Calling table.newScan() (or building a TableScan from it) on a SideInputTable inside a DoFn or custom read path.","commonSituations":"Custom read code that assumes any Iceberg Table can produce a TableScan; mixing direct Iceberg reads with Beam Iceberg IO side inputs.","solutions":["Use Beam's Iceberg IO read transforms instead of manual TableScan on side-input tables.","Create the scan from a catalog-loaded Table, or convert scan results to a side input before the pipeline runs.","Perform scan-based planning at pipeline construction time and ship results via SerializableTableSpec/SideInputTable."],"exampleFix":"// before\nCloseableIterable<Row> rows = sideInputTable.newScan().project(schema).planFiles()...;\n\n// after\npipeline.apply(IcebergIO.readRows(catalogConfig, tableIdentifier));","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean supportsScans = !(table instanceof SideInputTable);","tryCatchPattern":"try {\n  TableScan scan = table.newScan();\n} catch (UnsupportedOperationException e) {\n  if (!e.getMessage().contains(\"scans directly\")) throw e;\n  // use Beam Iceberg IO read transforms or a catalog-backed table\n}","preventionTips":["Use IcebergIO read transforms for reading in Beam pipelines instead of manual TableScan.","Do scan-based planning before building side inputs; ship results via SerializableTableSpec.","Keep TableScan usage restricted to catalog-backed Table instances."],"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"}