apache/beam · error · UnsupportedOperationException

%s.getSideInputWindow() should never be called. It is a priv

Error message

%s.getSideInputWindow() should never be called. It is a private implementation detail of sdk utilities. This message indicates a bug in the Beam SDK.

What it means

IdentityWindowFn.getDefaultWindowMappingFn() always throws UnsupportedOperationException. IdentityWindowFn is an internal placeholder window strategy and has no meaningful side-input window mapping; calling it means the internal utility was used in a context (side input lookup) it was never designed for.

Source

Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/util/IdentityWindowFn.java:100

  public void verifyCompatibility(WindowFn<?, ?> other) throws IncompatibleWindowException {
    throw new UnsupportedOperationException(
        String.format(
            "%s.verifyCompatibility() should never be called."
                + " It is a private implementation detail of sdk utilities."
                + " This message indicates a bug in the Beam SDK.",
            getClass().getCanonicalName()));
  }

  @Override
  public Coder<BoundedWindow> windowCoder() {
    // Safe because the prior WindowFn provides both the windows and the coder.
    // The Coder is _not_ actually a coder for an arbitrary BoundedWindow.
    return coder;
  }

  @Override
  public WindowMappingFn<BoundedWindow> getDefaultWindowMappingFn() {
    throw new UnsupportedOperationException(
        String.format(
            "%s.getSideInputWindow() should never be called."
                + " It is a private implementation detail of sdk utilities."
                + " This message indicates a bug in the Beam SDK.",
            getClass().getCanonicalName()));
  }

  @Override
  public boolean assignsToOneWindow() {
    return true;
  }
}

View on GitHub (pinned to 12126d8942)

Solutions

  1. Report as a Beam SDK bug with the stack trace
  2. Upgrade to a newer Beam release that may have fixed the internal usage
  3. Restructure the pipeline so the collection is not consumed as a side input when IdentityWindowFn is active
  4. Avoid writing custom transforms that swap a PCollection's WindowFn with IdentityWindowFn
Defensive patterns

Strategy: type-guard

Validate before calling

if (pcollection.getWindowingStrategy().getWindowFn() instanceof IdentityWindowFn) { throw new IllegalStateException("cannot use as side input"); }

Type guard

boolean mapsSideInputs = !(fn instanceof IdentityWindowFn);

Try / catch

try { fn.getDefaultWindowMappingFn(); } catch (UnsupportedOperationException e) { /* fall back to default mapping */ }

Prevention

When it happens

Trigger: Using an IdentityWindowFn-windowed PCollection as the main input of a side-input access (view.asList/MapElements with side inputs), which asks getDefaultWindowMappingFn() to map side-input windows.

Common situations: Pipeline bug where internal windowing plumbing leaked to the runner; user code indirectly requesting side-input views of an IdentityWindowFn collection.

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/431a195cd3f47bec. Report an issue: GitHub.