{"record":{"id":"886f4f89852b64cd","repo":"apache/beam","slug":"unexpected-composite-inbound-type-v","errorCode":null,"errorMessage":"unexpected composite inbound type: %v","messagePattern":"unexpected composite inbound type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/bind.go","lineNumber":327,"sourceCode":"\tif !typex.IsStructurallyAssignable(t, other) {\n\t\treturn nil, kind, errors.Errorf(\"%v is not assignable to %v\", t, other)\n\t}\n\treturn other, kind, nil\n}\n\nfunc inboundArity(t typex.FullType, isMain bool) (int, error) {\n\tif t.Class() == typex.Composite {\n\t\tswitch t.Type() {\n\t\tcase typex.KVType:\n\t\t\tif isMain {\n\t\t\t\treturn 2, nil\n\t\t\t}\n\t\t\t// A KV side input must be a single iterator/map.\n\t\t\treturn 1, nil\n\t\tcase typex.CoGBKType:\n\t\t\treturn len(t.Components()), nil\n\t\tdefault:\n\t\t\treturn 0, errors.Errorf(\"unexpected composite inbound type: %v\", t.Type())\n\t\t}\n\t}\n\treturn 1, nil\n}\n\nfunc trimIllegal(list []reflect.Type) []reflect.Type {\n\tvar ret []reflect.Type\n\tfor _, elm := range list {\n\t\tswitch typex.ClassOf(elm) {\n\t\tcase typex.Concrete, typex.Universal, typex.Container:\n\t\t\tret = append(ret, elm)\n\t\t}\n\t}\n\treturn ret\n}\n","sourceCodeStart":309,"sourceCodeEnd":343,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/bind.go#L309-L343","documentation":"inboundArity computes how many bindings a composite inbound type needs; only KV (1) and CoGBK (component count) are supported. Any other composite type throws this error. It exists so the binder can determine the number of inbound edges a DoFn parameter consumes.","triggerScenarios":"Computing input arity for a side input or main input whose composite FullType is neither KV nor CoGBK — e.g. a Windowed-wrapped or custom composite used where arity must be derived.","commonSituations":"Custom side input types not produced by beam.KV/beam.CoGBK helpers; internal graph manipulation with unusual composite types; SDK version mismatch introducing new composite kinds.","solutions":["Use standard side input shapes: beam.KV (single iterator/map) or beam.CoGBK (multi component) types.","Check t.Type() in the message and wrap/unwrap to KV or CoGBK before binding.","Avoid manually constructing composite typex types for inputs; build via beam.AsMap/beam.AsIter helpers.","Upgrade the SDK if a legitimately new composite type is in use and binder support is needed."],"exampleFix":"// before: custom composite as side input\nside := myCompositePColl\n// after: standard map side input\nside := beam.AsMap(s, kvPColl)","handlingStrategy":"validation","validationCode":"// Go: only KV and CoGBK composites have defined inbound arity\ntt := t.Type()\nif t.Class() == typex.Composite && tt != typex.KVType && tt != typex.CoGBKType {\n    return fmt.Errorf(\"composite %v unsupported for inbound arity\", tt)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create side inputs with beam.AsMap/beam.AsIter/beam.AsMultiMap helpers only.","Avoid custom composite typex types in input positions.","Keep SDK and runner versions aligned."],"tags":["go","type-binding","composite-type"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}