{"record":{"id":"d380ee19029e839b","repo":"apache/beam","slug":"sideinputtable-is-a-read-only-metadata-adapter-and-does-not-d380ee","errorCode":null,"errorMessage":"SideInputTable is a read-only metadata adapter and does not support statisticsFiles.","messagePattern":"SideInputTable is a read-only metadata adapter and does not support statisticsFiles\\.","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":213,"sourceCode":"    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(\n        \"SideInputTable is a read-only metadata adapter and does not support snapshots.\");\n  }\n\n  @Override\n  public Map<String, SnapshotRef> refs() {\n    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(","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SideInputTable.java#L195-L231","documentation":"SideInputTable.statisticsFiles() throws UnsupportedOperationException: table statistics files are not serialized into the side-input adapter, so listing them is unsupported. Statistics-based planning must use a catalog-backed table.","triggerScenarios":"Calling table.statisticsFiles() on a SideInputTable, e.g. from planner or optimizer code that consults statistics.","commonSituations":"Query-planning or file-skipping logic reused for side-input tables; generic Table-interface consumers.","solutions":["Do not rely on statistics with SideInputTable; reads are planned from the serialized data files/metadata.","Load the catalog-backed table when statistics are required.","Skip statistics code paths for SideInputTable instances."],"exampleFix":"// before\nList<StatisticsFile> stats = sideInputTable.statisticsFiles();\n\n// after\nList<StatisticsFile> stats = catalog.loadTable(identifier).statisticsFiles();","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean hasStatistics = !(table instanceof SideInputTable);","tryCatchPattern":"try {\n  List<StatisticsFile> stats = table.statisticsFiles();\n} catch (UnsupportedOperationException e) {\n  if (!e.getMessage().contains(\"statisticsFiles\")) throw e;\n  // proceed without statistics\n}","preventionTips":["Do not plan reads from statistics on side-input tables.","Consult statistics only at pipeline construction on catalog-backed tables.","Treat SideInputTable's serialized file list as the sole planning input."],"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"}