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 partitionStatisticsFiles.

What it means

SideInputTable.partitionStatisticsFiles() throws UnsupportedOperationException because partition statistics files are not carried in the read-only side-input metadata. Accessing them requires a live catalog table.

Solutions

  1. Rely on the serialized partitioning metadata in the spec instead of partition statistics.
  2. Load the real table from the catalog if partition statistics are mandatory.
  3. Condition partition-statistics logic on the table not being a SideInputTable.

Example fix

// before
List<PartitionStatisticsFile> pstats = sideInputTable.partitionStatisticsFiles();

// after
List<PartitionStatisticsFile> pstats = catalog.loadTable(identifier).partitionStatisticsFiles();
Defensive patterns

Strategy: type-guard

Type guard

boolean hasPartitionStats = !(table instanceof SideInputTable);

Try / catch

try {
  List<PartitionStatisticsFile> pstats = table.partitionStatisticsFiles();
} catch (UnsupportedOperationException e) {
  if (!e.getMessage().contains("partitionStatisticsFiles")) throw e;
  // fall back to serialized partition spec metadata
}

Prevention

When it happens

Trigger: Calling table.partitionStatisticsFiles() on a SideInputTable, typically during partition pruning or planning inside a worker.

Common situations: Partition-pruning utilities applied uniformly to all Table implementations; reuse of planner code on side inputs.

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


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/de10f0241206d4b3. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SideInputTable.java:219

    throw new UnsupportedOperationException(
        "SideInputTable is a read-only metadata adapter and does not support snapshots.");
  }

  @Override
  public Map<String, SnapshotRef> refs() {
    throw new UnsupportedOperationException(
        "SideInputTable is a read-only metadata adapter and does not support snapshot refs.");
  }

  @Override
  public List<StatisticsFile> statisticsFiles() {
    throw new UnsupportedOperationException(
        "SideInputTable is a read-only metadata adapter and does not support statisticsFiles.");
  }

  @Override
  public List<PartitionStatisticsFile> partitionStatisticsFiles() {
    throw new UnsupportedOperationException(
        "SideInputTable is a read-only metadata adapter and does not support partitionStatisticsFiles.");
  }

  @Override
  public TableScan newScan() {
    throw new UnsupportedOperationException(
        "SideInputTable is a read-only metadata adapter and does not support scans directly.");
  }

  @Override
  public IncrementalAppendScan newIncrementalAppendScan() {
    throw new UnsupportedOperationException(
        "SideInputTable is a read-only metadata adapter and does not support scans directly.");
  }

  @Override
  public IncrementalChangelogScan newIncrementalChangelogScan() {
    throw new UnsupportedOperationException(

View on GitHub (pinned to 12126d8942)