apache/beam · error

unknown fieldtype: %T

Error message

unknown fieldtype: %T

What it means

Default-case error in fieldTypeToReflectType: the FieldType's oneof payload (GetTypeInfo()) is a type the Go schema converter does not recognize at all. It reports the Go type of the unexpected protobuf wrapper via %T. IterableType, for example, is intentionally unimplemented (BEAM-9615) and falls through here or is handled elsewhere.

Source

Thrown at sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go:804

		rt, err := r.toType(sft.GetRowType().GetSchema())
		if err != nil {
			return nil, errors.Wrapf(err, "unable to convert row type: %v", sft.GetRowType().GetSchema().GetId())
		}
		t = rt
	// case *pipepb.FieldType_IterableType:
	// TODO(BEAM-9615): handle IterableTypes (eg. CoGBK values)

	case *pipepb.FieldType_LogicalType:
		lst := sft.GetLogicalType()
		identifier := lst.GetUrn()
		lt, ok := r.logicalTypes[identifier]
		if !ok {
			return nil, errors.Errorf("unknown logical type: %v", identifier)
		}
		t = lt.GoType()

	default:
		return nil, errors.Errorf("unknown fieldtype: %T", sft.GetTypeInfo())
	}
	if sft.GetNullable() {
		return reflect.PtrTo(t), nil
	}
	return t, nil
}

// parseTag splits a struct field's beam tag into its name and
// comma-separated options.
func parseTag(tag string) (string, options) {
	if idx := strings.Index(tag, ","); idx != -1 {
		return tag[:idx], options(tag[idx+1:])
	}
	return tag, options("")
}

type options string

View on GitHub (pinned to 12126d8942)

Solutions

  1. Upgrade the Beam Go SDK so both the switch and pipepb cover the new field type
  2. Avoid the unsupported field type in your schema (replace iterable fields with arrays/repeated rows)
  3. Regenerate/update vendored pipepb to match the pipeline's schema version
  4. Check the %T output in the message to identify exactly which FieldType wrapper is unhandled

Example fix

// before
field "vals" typed as iterable<int> in the schema (unsupported in Go)
// after
field "vals" typed as array<int> / repeated int64, or upgrade Beam Go SDK past the BEAM-9615 limitation
Defensive patterns

Strategy: type-guard

Validate before calling

switch sft.GetTypeInfo().(type) {
case *pipepb.FieldType_PrimitiveType, *pipepb.FieldType_MapType, *pipepb.FieldType_RowType, *pipepb.FieldType_LogicalType:
  // ok
default:
  return fmt.Errorf("unsupported FieldType %T", sft.GetTypeInfo())
}

Type guard

func isSupportedFieldType(ft *pipepb.FieldType) bool {
  switch ft.GetTypeInfo().(type) {
  case *pipepb.FieldType_PrimitiveType, *pipepb.FieldType_MapType,
       *pipepb.FieldType_RowType, *pipepb.FieldType_LogicalType:
    return true
  }
  return false
}

Try / catch

t, err := fieldTypeToReflectType(sft, nil)
if err != nil && strings.Contains(err.Error(), "unknown fieldtype") {
  return fmt.Errorf("upgrade Beam SDK or change field type %T", sft.GetTypeInfo())
}

Prevention

When it happens

Trigger: A *pipepb.FieldType carrying a case not handled by the switch (e.g. IterableType payloads or FieldType variants added in newer protobufs but absent in the compiled-in pipepb version), reached via fieldToStructField or recursion.

Common situations: Graphs produced by newer Beam SDKs containing field types unsupported by the running Go SDK; stale vendored pipepb; cross-language pipelines using iterable-typed schema fields (CoGBK values, TODO BEAM-9615).

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/41ba97e8b1ee6e9c. Report an issue: GitHub.