{"record":{"id":"1bf5354a2794de1a","repo":"apache/beam","slug":"unsupported-non-merging-windowfn-windowingstrategy","errorCode":null,"errorMessage":"Unsupported non-merging WindowFn: \" + windowingStrategy","messagePattern":"Unsupported non-merging WindowFn: \" \\+ windowingStrategy","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/runners/direct_runner.ts","lineNumber":209,"sourceCode":"    transform: PTransform,\n    context: operators.OperatorContext,\n  ) {\n    this.receiver = context.getReceiver(\n      onlyElement(Object.values(transform.outputs)),\n    );\n    const inputPc =\n      context.descriptor.pcollections[\n        onlyElement(Object.values(transform.inputs))\n      ];\n    this.keyCoder = context.pipelineContext.getCoder(\n      context.descriptor.coders[inputPc.coderId].componentCoderIds[0],\n    );\n    const windowingStrategy =\n      context.descriptor.windowingStrategies[inputPc.windowingStrategyId];\n    if (\n      windowingStrategy.mergeStatus !== runnerApi.MergeStatus_Enum.NON_MERGING\n    ) {\n      throw new Error(\"Unsupported non-merging WindowFn: \" + windowingStrategy);\n    }\n    if (\n      windowingStrategy.outputTime !== runnerApi.OutputTime_Enum.END_OF_WINDOW\n    ) {\n      throw new Error(\n        \"Unsupported windowing output time: \" + windowingStrategy,\n      );\n    }\n    this.windowCoder = context.pipelineContext.getCoder(\n      windowingStrategy.windowCoderId,\n    );\n  }\n\n  process(wvalue: WindowedValue<any>) {\n    for (const window of wvalue.windows) {\n      const wkey =\n        operators.encodeToBase64(window, this.windowCoder) +\n        \" \" +","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/runners/direct_runner.ts#L191-L227","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Replace merging windows (sessions/sliding) with non-merging windows (GlobalWindows or FixedWindows) for this runner.","Run the pipeline on a runner that supports merging windows (e.g. Flink, Dataflow) instead of the direct runner.","Approximate sessions with non-merging fixed windows plus post-hoc grouping if sessions are not strictly required."],"exampleFix":"// before\npc.apply(win.withFixedDuration(...)).apply(win.intoSessions(...));\n// after\npc.apply(win.withFixedDuration(...)).apply(win.intoFixedWindows(...)); // non-merging","handlingStrategy":"validation","validationCode":"// before running on the direct runner\nif (usesMergingWindows(pipeline)) {\n  throw new Error('Direct runner does not support merging windows (sessions/sliding)');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer GlobalWindows/FixedWindows on the direct runner.","Move session/sliding window pipelines to Flink or Dataflow.","Document windowing limitations of the TypeScript direct runner in team docs."],"tags":["windowing","unsupported","direct-runner","limitations"],"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"}