apache/beam · error · UnsupportedOperationException
.isCompatible() should never be called. It is a private…
Error message
%s.isCompatible() 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 is a private implementation detail used internally by SDK utilities (e.g. to pass windows through unchanged). Its isCompatible() is deliberately unimplemented: calling it means Beam's internal plumbing invoked a WindowFn that was never meant to participate in window-merging compatibility checks — a genuine SDK bug.
Solutions
- Remove user-level use of IdentityWindowFn; it is not a public API — use Window.into()/reassign semantics instead
- Report the stack trace to the Beam project (JIRA/GitHub) — the message itself says this indicates a Beam SDK bug
- Check for mismatched Beam SDK versions on the classpath (e.g. runner vs SDK) and align them
Example fix
// before PCollection<T> out = c.apply(new IdentityWindowFn<>(originalWindowFn.windowCoder())); // after PCollection<T> out = c.apply(Window.<T>into(originalWindowFn)); // public API, or don't reassign windows at all
Defensive patterns
Strategy: try-catch
Try / catch
try {
windowFn.isCompatible(other);
} catch (UnsupportedOperationException e) {
LOG.error("IdentityWindowFn.isCompatible invoked — likely a Beam SDK bug; report stack trace", e);
throw e;
} Prevention
- Do not use IdentityWindowFn in user pipelines; it is an internal utility
- Keep runner and SDK Beam versions aligned
- Report occurrences with full stack traces to the Beam project
When it happens
Trigger: Calling isCompatible() directly on IdentityWindowFn, or pipeline code that requires window-fn compatibility checking across an IdentityWindowFn boundary (e.g. applying it in a user pipeline or combining it with windowing operations the SDK doesn't expect).
Common situations: Users manually constructing IdentityWindowFn in custom transforms; Beam version mismatches where internal utilities changed; custom runners calling isCompatible during stage planning on windows propagated via IdentityWindowFn.
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
- Cannot access OnWindowExpirationContext outside of…
- Adding required columns is not yet supported. Encountered…
- AUTO is applicable only to reading files
- BeamAccumulatorProvider doesn't support getCounter(String…
- BeamAccumulatorProvider doesn't support getHistogram(String…
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/cc589049dc06a179.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/util/IdentityWindowFn.java:73
public IdentityWindowFn(Coder<? extends BoundedWindow> coder) {
// Safe because it is only used privately here.
// At every point where a window is returned or accepted, it has been provided
// by the prior WindowFn, so it is of the expected type.
@SuppressWarnings("unchecked")
Coder<BoundedWindow> windowCoder = (Coder<BoundedWindow>) coder;
this.coder = windowCoder;
}
@Override
public Collection<BoundedWindow> assignWindows(WindowFn<T, BoundedWindow>.AssignContext c)
throws Exception {
// The window is provided by the prior WindowFn, which also provides the coder for them
return Collections.singleton(c.window());
}
@Override
public boolean isCompatible(WindowFn<?, ?> other) {
throw new UnsupportedOperationException(
String.format(
"%s.isCompatible() 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 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()));
}
@OverrideView on GitHub (pinned to 12126d8942)