{"record":{"id":"a98f61939def45a0","repo":"apache/beam","slug":"session-windowing-is-not-supported-for-side-inputs","errorCode":null,"errorMessage":"session windowing is not supported for side inputs","messagePattern":"session windowing is not supported for side inputs","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/translate.go","lineNumber":360,"sourceCode":"\t\t\tPayload: []byte(mustEncodeMultiEdge),\n\t\t},\n\t\tAccumulatorCoderId: acID,\n\t}\n\ttransform.Spec = &pipepb.FunctionSpec{Urn: URNCombinePerKey, Payload: protox.MustEncode(payload)}\n\treturn nil\n}\n\nfunc getSideWindowMappingUrn(winFn *window.Fn) string {\n\tvar mappingUrn string\n\tswitch winFn.Kind {\n\tcase window.GlobalWindows:\n\t\tmappingUrn = URNWindowMappingGlobal\n\tcase window.FixedWindows:\n\t\tmappingUrn = URNWindowMappingFixed\n\tcase window.SlidingWindows:\n\t\tmappingUrn = URNWindowMappingSliding\n\tcase window.Sessions:\n\t\tpanic(\"session windowing is not supported for side inputs\")\n\t}\n\treturn mappingUrn\n}\n\nfunc (m *marshaller) addMultiEdge(edge NamedEdge) ([]string, error) {\n\thandleErr := func(err error) ([]string, error) {\n\t\treturn nil, errors.Wrapf(err, \"failed to add input kind: %v\", edge)\n\t}\n\tid := edgeID(edge.Edge)\n\tif _, exists := m.transforms[id]; exists {\n\t\treturn []string{id}, nil\n\t}\n\n\tswitch {\n\tcase edge.Edge.Op == graph.CoGBK && len(edge.Edge.Input) > 1:\n\t\tcogbkID, err := m.expandCoGBK(edge)\n\t\tif err != nil {\n\t\t\treturn handleErr(err)","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/translate.go#L342-L378","documentation":"When a ParDo consumes side inputs, the pipeline translation must express a window mapping URN (global/fixed/sliding) in the portable representation. Session windowing has no corresponding side-input mapping in the runner protocol, so translation panics for window.Sessions.","triggerScenarios":"Building a pipeline where a DoFn accesses a side input (beam.SideInput) from a PCollection windowed with window.NewSessions(...) — detected in getSideWindowMappingUrn during addMultiEdge.","commonSituations":"Combining session windows with side-input lookups in the same stage; copying a side-input pattern from fixed-window code into session-windowed pipelines.","solutions":["Restructure the pipeline so the side input comes from a non-session-windowed PCollection (e.g. re-window to fixed or global windows)","Explode session results into elements and join via CoGBK instead of side inputs","Pre-compute side-input data in a separate stage with global or fixed windows"],"exampleFix":"// before\nbeam.WindowInto(scope, window.NewSessions(5*time.Minute), side)\n// after\nside = beam.WindowInto(scope, window.NewFixedWindows(5*time.Minute), side)","handlingStrategy":"validation","validationCode":"if isSessionWindowed(sideInputPCol) {\n    return errors.New(\"side inputs cannot use session windows; re-window to fixed/global\")\n}","typeGuard":"func isSessionWindowed(ws window.WindowingStrategy) bool {\n    _, ok := ws.WindowFn.(window.Sessions); return ok\n}","tryCatchPattern":"defer func() { if r := recover(); r != nil { err = fmt.Errorf(\"side input translation: %v\", r) } }()","preventionTips":["Never combine window.Sessions with side inputs in the same stage","Use CoGBK joins instead of side inputs for session data","Re-window session results to fixed windows before side input use"],"tags":["go","apache-beam","windowing","side-input","panic"],"backgroundTag":"unsupported-operation","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"}