{"record":{"id":"0bb14dfcd39c184b","repo":"apache/beam","slug":"unexpected-windowing-strategy-for-coder-v","errorCode":null,"errorMessage":"unexpected windowing strategy for coder: %v","messagePattern":"unexpected windowing strategy for coder: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/translate.go","lineNumber":1476,"sourceCode":"\t\t\tPayload: protox.MustEncode(\n\t\t\t\t&pipepb.SessionWindowsPayload{\n\t\t\t\t\tGapSize: durationpb.New(w.Gap),\n\t\t\t\t},\n\t\t\t),\n\t\t}, nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unexpected windowing strategy: %v\", w)\n\t}\n}\n\nfunc makeWindowCoder(w *window.Fn) (*coder.WindowCoder, error) {\n\tswitch w.Kind {\n\tcase window.GlobalWindows:\n\t\treturn coder.NewGlobalWindow(), nil\n\tcase window.FixedWindows, window.SlidingWindows, window.Sessions, URNSlidingWindowsWindowFn:\n\t\treturn coder.NewIntervalWindow(), nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unexpected windowing strategy for coder: %v\", w)\n\t}\n}\n\nfunc mustEncodeMultiEdgeBase64(edge *graph.MultiEdge) (string, error) {\n\tref, err := EncodeMultiEdge(edge)\n\tif err != nil {\n\t\treturn \"\", errors.Wrapf(err, \"failed to serialize %v\", edge)\n\t}\n\treturn protox.MustEncodeBase64(&v1pb.TransformPayload{\n\t\tUrn:  URNDoFn,\n\t\tEdge: ref,\n\t}), nil\n}\n\nfunc edgeID(edge *graph.MultiEdge) string {\n\treturn fmt.Sprintf(\"e%v\", edge.ID())\n}\n","sourceCodeStart":1458,"sourceCodeEnd":1494,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/translate.go#L1458-L1494","documentation":"During pipeline translation to the Beam runner proto format, each PCollection's windowing strategy must map to a known window coder. This error is thrown when a windowfn kind is not one of GlobalWindows, FixedWindows, SlidingWindows, Sessions, or the known sliding-windows URN, so graphx cannot pick a window coder for serialization.","triggerScenarios":"Calling window.As/beam.WindowInto with a custom or unrecognized windowfn whose kind does not match any case in translateWindowCoder, so EncodeWindowCoder fails while marshaling the pipeline.","commonSituations":"Implementing a custom windowFn without registering it in graphx; using a third-party window strategy unsupported by the Go SDK; SDK/runner version mismatch where a new window kind is not yet handled by the translator.","solutions":["Use one of the supported windowings: window.NewGlobalWindows, NewFixedWindows, NewSlidingWindows, or NewSessions.","If a custom windowFn is required, check that its Kind() and URN match a case in translate.go's window coder switch, or register an equivalent URN.","Upgrade or downgrade the Beam Go SDK so the window kind is supported by graphx translation."],"exampleFix":"// before\nw := beam.WindowInto(s, myCustomWindowFn{}, in)\n// after\nw := beam.WindowInto(s, window.NewFixedWindows(60*time.Second), in)","handlingStrategy":"validation","validationCode":"switch wfn.Kind() {\ncase window.KindGlobalWindow, window.KindFixedWindows, window.KindSlidingWindows, window.KindSessions:\n    // supported\ndefault:\n    return fmt.Errorf(\"windowing strategy %T unsupported by Go SDK translation\", wfn)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stick to window.GlobalWindows, FixedWindows, SlidingWindows, or Sessions in Go pipelines.","Before adding a custom windowFn, confirm graphx translate.go handles its kind/URN.","Pin SDK versions across pipeline construction and runner."],"tags":["go","apache-beam","windowing","pipeline-translation"],"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"}