{"record":{"id":"3e4e786cf0a7de99","repo":"apache/beam","slug":"unknown-logical-type-v","errorCode":null,"errorMessage":"unknown logical type: %v","messagePattern":"unknown logical type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go","lineNumber":799,"sourceCode":"\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\n\t// case *pipepb.FieldType_IterableType:\n\t// TODO(BEAM-9615): handle IterableTypes (eg. CoGBK values)\n\n\tcase *pipepb.FieldType_LogicalType:\n\t\tlst := sft.GetLogicalType()\n\t\tidentifier := lst.GetUrn()\n\t\tlt, ok := r.logicalTypes[identifier]\n\t\tif !ok {\n\t\t\treturn nil, errors.Errorf(\"unknown logical type: %v\", identifier)\n\t\t}\n\t\tt = lt.GoType()\n\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unknown fieldtype: %T\", sft.GetTypeInfo())\n\t}\n\tif sft.GetNullable() {\n\t\treturn reflect.PtrTo(t), nil\n\t}\n\treturn t, nil\n}\n\n// parseTag splits a struct field's beam tag into its name and\n// comma-separated options.\nfunc parseTag(tag string) (string, options) {\n\tif idx := strings.Index(tag, \",\"); idx != -1 {\n\t\treturn tag[:idx], options(tag[idx+1:])\n\t}","sourceCodeStart":781,"sourceCodeEnd":817,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go#L781-L817","documentation":"Returned by fieldTypeToReflectType when a FieldType has a LogicalType whose URN is not a key in the registry r.logicalTypes. The Go SDK can only materialize logical types that have been explicitly mapped to a Go type. Unknown URNs make the Go struct representation impossible, so the conversion aborts.","triggerScenarios":"Decoding a schema containing *pipepb.FieldType_LogicalType with a URN absent from r.logicalTypes — typical for custom logical types from Python/Java, or newer built-in logical types when running an older Go SDK.","commonSituations":"Cross-language pipelines emitting custom logical types (e.g. Python LogicalType subclasses); Beam version mismatch where the writer SDK emits a logical type the reader Go SDK predates; forgotten schema.RegisterLogicalType call in the worker main.","solutions":["Register the logical type via schema.RegisterLogicalType with a matching URN implementing the LogicalType interface","Upgrade the Beam Go SDK to a version that knows the built-in URN in question","Change the pipeline to emit a plain primitive or RowType instead of the custom logical type","Print/log available registered URNs to confirm the missing identifier"],"exampleFix":"// before\ntype Money struct{} // no registration; URN \"myco:money\" unknown to Go\n// after\ntype MoneyLogicalType struct{}\nfunc (MoneyLogicalType) Urn() string { return \"myco:money\" }\nfunc (MoneyLogicalType) GoType() reflect.Type { return reflect.TypeOf(Money{}) }\nfunc init() { schema.RegisterLogicalType(MoneyLogicalType{}) }","handlingStrategy":"validation","validationCode":"if _, ok := registry[urn]; !ok {\n  return fmt.Errorf(\"logical type %q not registered; call schema.RegisterLogicalType in init()\", urn)\n}","typeGuard":"func logicalTypeRegistered(urn string, r *Representer) bool {\n  _, ok := r.logicalTypes[urn]\n  return ok\n}","tryCatchPattern":"lt, err := resolveLogicalType(urn)\nif err != nil {\n  if isUnknownURN(err) { registerMissing(urn); lt, err = resolveLogicalType(urn) }\n  if err != nil { return err }\n}","preventionTips":["Register all custom LogicalTypes via init() in every binary that decodes schemas","Match URNs exactly (case, namespace) between producing SDK and Go registration","Upgrade Beam Go SDK when built-in logical type URNs are rejected","Avoid Python/Java custom logical types in fields consumed by Go"],"tags":["go","beam","schema","logical-type"],"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-20T03:17:13.778Z"}