{"record":{"id":"f27dff570e079f61","repo":"apache/beam","slug":"unsupported-window-mapping-fn-sideinput-windowmappingfn-urn","errorCode":null,"errorMessage":"Unsupported window mapping fn: ${sideInput.windowMappingFn.urn}","messagePattern":"Unsupported window mapping fn: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/worker/pardo_context.ts","lineNumber":218,"sourceCode":"\nexport function createSideInputInfo(\n  transformProto: runnerApi.PTransform,\n  spec: runnerApi.ParDoPayload,\n  operatorContext: operators.OperatorContext,\n): Map<string, SideInputInfo> {\n  const globalWindow = new GlobalWindow();\n  const sideInputInfo: Map<string, SideInputInfo> = new Map();\n  for (const [sideInputId, sideInput] of Object.entries(spec.sideInputs)) {\n    let windowMappingFn: (window: Window) => Window;\n    switch (sideInput.windowMappingFn!.urn) {\n      case urns.GLOBAL_WINDOW_MAPPING_FN_URN:\n        windowMappingFn = (window) => globalWindow;\n        break;\n      case urns.IDENTITY_WINDOW_MAPPING_FN_URN:\n        windowMappingFn = (window) => window;\n        break;\n      default:\n        throw new Error(\n          \"Unsupported window mapping fn: \" + sideInput.windowMappingFn!.urn,\n        );\n    }\n    const sidePColl =\n      operatorContext.descriptor.pcollections[\n        transformProto.inputs[sideInputId]\n      ];\n    const windowingStrategy =\n      operatorContext.pipelineContext.getWindowingStrategy(\n        sidePColl.windowingStrategyId,\n      );\n    sideInputInfo.set(sideInputId, {\n      elementCoder: operatorContext.pipelineContext.getCoder(sidePColl.coderId),\n      windowCoder: operatorContext.pipelineContext.getCoder(\n        windowingStrategy.windowCoderId,\n      ),\n      windowMappingFn: windowMappingFn,\n    });","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/worker/pardo_context.ts#L200-L236","documentation":"When building side-input metadata in createSideInputInfo, the worker maps the side input's windowMappingFn URN to a JS function (e.g. global window or identity). Any other URN is rejected with this Error because the worker cannot translate that window-mapping behavior.","triggerScenarios":"A pipeline declares a side input whose windowMappingFn URN is neither the global-window nor identity URN (e.g. a custom or SDK-side mapping function like windows-into-days) consumed by a DoFn running on this TypeScript worker.","commonSituations":"Using side inputs with non-global window mappings in a pipeline executed by the TS worker; submitting a job built by a Python/Java SDK whose windowing mapping functions the TS worker doesn't support.","solutions":["Restructure the pipeline so the side input uses a global-window or identity window mapping fn.","Pre-materialize the side input with the desired windowing applied upstream (e.g. via a View or re-windowing step) instead of relying on a custom mapping fn.","Upgrade the worker if a newer release added support for that URN.","Run the affected transform on a runtime that supports the mapping fn (e.g. the Java/Python worker)."],"exampleFix":"// before\n// pcoll | beam.Map(lambda x, side: ..., side=AsDictionary(pcoll_with_custom_window_mapping))\n// after\n// use identity or default global mapping, or re-window the side input upstream to globalWindow","handlingStrategy":"validation","validationCode":"// before building the pipeline graph, inspect side input specs\nfor (const si of sideInputs) {\n  const urn = si.windowMappingFn?.urn;\n  if (urn && ![GLOBAL_WINDOW_URN, IDENTITY_WINDOW_MAPPING_FN_URN].includes(urn)) {\n    throw new Error(`Unsupported side-input mapping ${urn}; re-window upstream`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer default/global side-input window mapping","Apply desired windowing to the side input collection upstream","Check URN support of the TS worker before using view/windowing features from other SDKs"],"tags":["beam","worker","side-input","windowing"],"backgroundTag":"unsupported-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}