{"record":{"id":"12d69411c8c60a4a","repo":"apache/beam","slug":"unexpected-sideinput-to-combine-got-d-want-1","errorCode":null,"errorMessage":"unexpected sideinput to combine: got %d, want 1","messagePattern":"unexpected sideinput to combine: got (.+?), want 1","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/translate.go","lineNumber":671,"sourceCode":"\t\t\t\t\t\tu = &SdfFallback{PDo: n}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tcase graph.Combine:\n\t\t\t\tcn := &Combine{UID: b.idgen.New(), Out: out[0]}\n\t\t\t\tcn.Fn, err = graph.AsCombineFn(fn)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tcn.UsesKey = typex.IsKV(in[0].Type)\n\n\t\t\t\tcn.PID = id.to\n\n\t\t\t\tswitch urn {\n\t\t\t\tcase urnPerKeyCombinePre:\n\t\t\t\t\tinputs := unmarshalKeyedValues(transform.GetInputs())\n\t\t\t\t\tif len(inputs) != 1 {\n\t\t\t\t\t\treturn nil, errors.Errorf(\"unexpected sideinput to combine: got %d, want 1\", len(inputs))\n\t\t\t\t\t}\n\t\t\t\t\tec, wc, err := b.makeCoderForPCollection(inputs[0])\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tif !coder.IsKV(ec) {\n\t\t\t\t\t\treturn nil, errors.Errorf(\"unexpected non-KV coder PCollection input to combine: %v\", ec)\n\t\t\t\t\t}\n\t\t\t\t\tu = &LiftedCombine{Combine: cn, KeyCoder: ec.Components[0], WindowCoder: wc}\n\t\t\t\tcase urnPerKeyCombineMerge:\n\t\t\t\t\tma := &MergeAccumulators{Combine: cn}\n\t\t\t\t\tif pc, ok := ma.Out.(*PCollection); ok {\n\t\t\t\t\t\tif eo, ok := pc.Out.(*ExtractOutput); ok {\n\t\t\t\t\t\t\t// Strip PCollections from between MergeAccumulators and ExtractOutputs\n\t\t\t\t\t\t\t// as it's a synthetic PCollection.\n\t\t\t\t\t\t\tb.units = b.units[:len(b.units)-1]\n\t\t\t\t\t\t\tma.Out = eo\n\t\t\t\t\t\t}","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/translate.go#L653-L689","documentation":"When translating a lifted per-key combine (urnPerKeyCombinePre), makeLink expects exactly one main input. unmarshalKeyedValues returns the non-side inputs; more (or fewer) than one means a side input was wired into the combine, which the lifted-combine translation cannot represent.","triggerScenarios":"A Combine PerKey transform that also declares side inputs, or a pipeline protobuf whose Inputs map yields >1 keyed values for the pre-combine step; custom runners emitting multiple inputs on the combine transform.","commonSituations":"Custom/foreign runners translating via the FnAPI incorrectly; hand-modified pipeline graphs; combining with side inputs — an unsupported pattern.","solutions":["Refactor the pipeline so the Combine has a single main input; fetch side-input data before or after the combine","Inspect the submitted pipeline proto's transform Inputs and remove extra inputs","Report/fix the runner-side translation that adds inputs to urnPerKeyCombinePre transforms"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"inputs := unmarshalKeyedValues(transform.GetInputs())\nif len(inputs) != 1 {\n\treturn fmt.Errorf(\"combine must have exactly one main input, has %d\", len(inputs))\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Avoid attaching side inputs directly to Combine PerKey transforms","Inspect the submitted pipeline proto for unexpected inputs on combine nodes","Prefer fetching side-input data outside the combine"],"tags":["go","apache-beam","combine","pipeline-translation"],"backgroundTag":"invalid-argument-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"}