{"record":{"id":"78928c9ec5ba3eeb","repo":"apache/beam","slug":"mismatched-cogbk-windowing-strategies-v-want-v","errorCode":null,"errorMessage":"mismatched CoGBK windowing strategies: %v, want %v","messagePattern":"mismatched CoGBK windowing strategies: (.+?), want (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/edge.go","lineNumber":228,"sourceCode":"\t}\n\n\t// (1) Create CoGBK result type: KV<T,U>, .., KV<T,Z> -> CoGBK<T,U,..,Z>.\n\n\tc := ns[0].Coder.Components[0]\n\tw := inputWindow(ns)\n\tbounded := inputBounded(ns)\n\tcomp := []typex.FullType{c.T, ns[0].Type().Components()[1]}\n\n\tfor i := 1; i < len(ns); i++ {\n\t\tn := ns[i]\n\t\tif !typex.IsKV(n.Type()) {\n\t\t\treturn nil, addContext(errors.Errorf(\"input type must be KV: %v\", n), s)\n\t\t}\n\t\tif !n.Coder.Components[0].Equals(c) {\n\t\t\treturn nil, addContext(errors.Errorf(\"key coder for %v is %v, want %v\", n, n.Coder.Components[0], c), s)\n\t\t}\n\t\tif !w.Equals(n.WindowingStrategy()) {\n\t\t\treturn nil, addContext(errors.Errorf(\"mismatched CoGBK windowing strategies: %v, want %v\", n.WindowingStrategy(), w), s)\n\t\t}\n\t\tif bounded != n.Bounded() {\n\t\t\treturn nil, addContext(errors.Errorf(\"unmatched CoGBK boundedness: %v, want %v\", n.Bounded(), bounded), s)\n\t\t}\n\n\t\tcomp = append(comp, n.Type().Components()[1])\n\t}\n\n\tt := typex.NewCoGBK(comp...)\n\tout := g.NewNode(t, w, bounded)\n\n\t// (2) Add CoGBK edge\n\n\tedge := g.NewEdge(s)\n\tedge.Op = CoGBK\n\tfor i := 0; i < len(ns); i++ {\n\t\tedge.Input = append(edge.Input, &Inbound{Kind: Main, From: ns[i], Type: ns[i].Type()})\n\t}","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/edge.go#L210-L246","documentation":"Error returned by NewCoGBK when an input's windowing strategy differs from the first input's (w). All inputs to a CoGBK must share the same windowing strategy so per-window grouping is well defined; the message shows the mismatched strategy versus the expected one.","triggerScenarios":"CoGroupByKey combining a bounded/unbounded input, or inputs with different triggers, allowed lateness, or window assignments (e.g. fixed vs global windows).","commonSituations":"Mixing batch and streaming sources in one CoGroupByKey, or applying custom windowing to only some inputs.","solutions":["Apply the same windowing (beam.WindowInto with identical strategy) to all inputs before CoGroupByKey","Align boundedness: re-window streaming inputs or re-read batch inputs consistently","Inspect each PCollection's WindowingStrategy in tests to confirm equality"],"exampleFix":"// before\nwA := beam.WindowInto(s, window.NewFixedWindows(60), a)\nbeam.CoGroupByKey(s, wA, b) // b global windows\n// after\nwB := beam.WindowInto(s, window.NewFixedWindows(60), b)\nbeam.CoGroupByKey(s, wA, wB)","handlingStrategy":"validation","validationCode":"strategy := inputs[0].WindowingStrategy()\nfor i, c := range inputs[1:] {\n    if !strategy.Equals(c.WindowingStrategy()) {\n        return fmt.Errorf(\"input %d windowing mismatch\", i+1)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := beam.TryCoGroupByKey(s, a, b); err != nil {\n    return fmt.Errorf(\"CoGroupByKey windowing strategies differ: %w\", err)\n}","preventionTips":["Apply identical beam.WindowInto strategies to all CoGBK inputs","Avoid mixing bounded and unbounded inputs in one CoGroupByKey","Assert windowing strategy equality in pipeline construction tests"],"tags":["go","beam","windowing","cogbk"],"backgroundTag":"conflicting-config-options","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}