apache/beam · error

Unsupported non-merging WindowFn: " + windowingStrategy

Error message

Unsupported non-merging WindowFn: " + windowingStrategy

What it means

The direct runner's PCollection handling checks the pipeline's windowing strategy and only supports NON_MERGING window functions (i.e. global windows / fixed windows that never merge). If the strategy's mergeStatus is not NON_MERGING, the constructor throws, because this runner cannot implement merging window semantics (sliding/session windows).

Solutions

  1. Replace merging windows (sessions/sliding) with non-merging windows (GlobalWindows or FixedWindows) for this runner.
  2. Run the pipeline on a runner that supports merging windows (e.g. Flink, Dataflow) instead of the direct runner.
  3. Approximate sessions with non-merging fixed windows plus post-hoc grouping if sessions are not strictly required.

Example fix

// before
pc.apply(win.withFixedDuration(...)).apply(win.intoSessions(...));
// after
pc.apply(win.withFixedDuration(...)).apply(win.intoFixedWindows(...)); // non-merging
Defensive patterns

Strategy: validation

Validate before calling

// before running on the direct runner
if (usesMergingWindows(pipeline)) {
  throw new Error('Direct runner does not support merging windows (sessions/sliding)');
}

Prevention

When it happens

Trigger: Building a pipeline whose input PCollection uses a merging WindowFn — e.g. Sessions.windows() or SlidingWindows — and running it with the direct (TypeScript portable) runner.

Common situations: Users applying session or sliding window transforms to a pipeline executed by the direct runner; copy-pasting a Python/Java Beam pipeline that supports sessions into the TypeScript runner.

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/1bf5354a2794de1a. Report an issue: GitHub.

Appendix: source

Thrown at sdks/typescript/src/apache_beam/runners/direct_runner.ts:209

    transform: PTransform,
    context: operators.OperatorContext,
  ) {
    this.receiver = context.getReceiver(
      onlyElement(Object.values(transform.outputs)),
    );
    const inputPc =
      context.descriptor.pcollections[
        onlyElement(Object.values(transform.inputs))
      ];
    this.keyCoder = context.pipelineContext.getCoder(
      context.descriptor.coders[inputPc.coderId].componentCoderIds[0],
    );
    const windowingStrategy =
      context.descriptor.windowingStrategies[inputPc.windowingStrategyId];
    if (
      windowingStrategy.mergeStatus !== runnerApi.MergeStatus_Enum.NON_MERGING
    ) {
      throw new Error("Unsupported non-merging WindowFn: " + windowingStrategy);
    }
    if (
      windowingStrategy.outputTime !== runnerApi.OutputTime_Enum.END_OF_WINDOW
    ) {
      throw new Error(
        "Unsupported windowing output time: " + windowingStrategy,
      );
    }
    this.windowCoder = context.pipelineContext.getCoder(
      windowingStrategy.windowCoderId,
    );
  }

  process(wvalue: WindowedValue<any>) {
    for (const window of wvalue.windows) {
      const wkey =
        operators.encodeToBase64(window, this.windowCoder) +
        " " +

View on GitHub (pinned to 12126d8942)