{"record":{"id":"c7ccf11421c9fcae","repo":"apache/beam","slug":"unable-to-convert-array-element-type","errorCode":null,"errorMessage":"unable to convert array element type","messagePattern":"unable to convert array element type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go","lineNumber":772,"sourceCode":"\tpipepb.AtomicType_FLOAT:   reflectx.Float32,\n\tpipepb.AtomicType_DOUBLE:  reflectx.Float64,\n\tpipepb.AtomicType_STRING:  reflectx.String,\n\tpipepb.AtomicType_BOOLEAN: reflectx.Bool,\n\tpipepb.AtomicType_BYTES:   reflectx.ByteSlice,\n}\n\nfunc (r *Registry) fieldTypeToReflectType(sft *pipepb.FieldType, opts []*pipepb.Option) (reflect.Type, error) {\n\tvar t reflect.Type\n\tswitch sft.GetTypeInfo().(type) {\n\tcase *pipepb.FieldType_AtomicType:\n\t\tvar ok bool\n\t\tif t, ok = atomicTypeToReflectType[sft.GetAtomicType()]; !ok {\n\t\t\treturn nil, errors.Errorf(\"unknown atomic type: %v\", sft.GetAtomicType())\n\t\t}\n\tcase *pipepb.FieldType_ArrayType:\n\t\trt, err := r.fieldTypeToReflectType(sft.GetArrayType().GetElementType(), nil)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"unable to convert array element type\")\n\t\t}\n\t\tt = reflect.SliceOf(rt)\n\tcase *pipepb.FieldType_MapType:\n\t\tkt, err := r.fieldTypeToReflectType(sft.GetMapType().GetKeyType(), nil)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"unable to convert map key type\")\n\t\t}\n\t\tvt, err := r.fieldTypeToReflectType(sft.GetMapType().GetValueType(), nil)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"unable to convert map value type\")\n\t\t}\n\t\tt = reflect.MapOf(kt, vt) // Panics for invalid map keys (slices/iterables)\n\tcase *pipepb.FieldType_RowType:\n\t\trt, err := r.toType(sft.GetRowType().GetSchema())\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"unable to convert row type: %v\", sft.GetRowType().GetSchema().GetId())\n\t\t}\n\t\tt = rt","sourceCodeStart":754,"sourceCodeEnd":790,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go#L754-L790","documentation":"Wrapper error raised when the element type of an ArrayType field fails recursive conversion in Registry.fieldTypeToReflectType. The array itself is representable; its element type is not (unknown atomic, unregistered logical type, or nested unsupported container), and this message adds array context.","triggerScenarios":"fieldToStructField/toType processing a schema whose FieldType_ArrayType element fails fieldTypeToReflectType — e.g. elements are an unmapped AtomicType or an unregistered logical type.","commonSituations":"Reconstructing Go types from schemas received from other SDKs or stored pipelines where the array's element type references a logical type absent from the current process's registry.","solutions":["Follow the wrapped inner error to the failing element type","Register the missing logical type URN before calling ToType","Upgrade the Go SDK if the element is a newer atomic type","Change the producer schema so array elements use supported types"],"exampleFix":"// before: array of unregistered logical type\n// after\nschema.RegisterLogicalType(uuidProvider{}) // makes []uuid elements convertible","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"unable to convert array element type\") {\n  return fmt.Errorf(\"array element unsupported in schema: %w\", err)\n}","preventionTips":["Register logical types used as array elements before ToType","Keep array elements to atoms or registered structs","Round-trip test schemas received from other SDKs"],"tags":["go","apache-beam","schema","array","recursion"],"backgroundTag":"schema-validation-failed","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"}