apache/beam · error

unsupported window mapping fn URN

Error message

unsupported window mapping fn URN %v

What it means

unmarshalAndMakeWindowMapping converts a WindowMappingFn proto (by URN) into an executable window mapper. If the URN is not one of the recognized mappings (global, session, fixed-windows, sliding-windows), the translation cannot proceed. This means the pipeline graph references a window-mapping function this SDK build does not know.

Solutions

  1. Use a supported window mapping (global default, sessions, fixed, or sliding windows) in the pipeline.
  2. Align SDK versions: regenerate the pipeline with a Beam version whose Go runner supports the URN.
  3. If cross-language, ensure the mapping fn is materialized on the producing side in a supported form.
  4. Add a case in unmarshalAndMakeWindowMapping if you own the code and need a new URN registered.

Example fix

// before: custom/unknown mapping URN from another SDK
wfn := window.MapWindows(customMapper{})
// after: use a supported mapping
w := window.NewFixedWindows(60 * time.Second) // supported by Go translate
Defensive patterns

Strategy: validation

Validate before calling

supported := map[string]bool{"beam:window_fn:global_windows:v1": true, "beam:window_fn:session_windows:v1": true, "beam:window_fn:fixed_windows:v1": true, "beam:window_fn:sliding_windows:v1": true}
if !supported[urn] { return fmt.Errorf("unsupported window mapping URN %q", urn) }

Type guard

func isSupportedWindowURN(urn string) bool { switch urn { case "beam:window_fn:global_windows:v1", "beam:window_fn:fixed_windows:v1", "beam:window_fn:sliding_windows:v1", "beam:window_fn:session_windows:v1": return true }; return false }

Try / catch

mapper, err := unmarshalAndMakeWindowMapping(pb.GetWindowMappingFn())
if err != nil {
    return nil, fmt.Errorf("window mapping unsupported on Go runner: %w", err)
}

Prevention

When it happens

Trigger: Deserializing a pipeline whose PTransform/GBK edge carries a window mapping URN produced by a newer SDK, another language SDK, or a custom mapping fn — then translating it for Go execution.

Common situations: Cross-language pipelines where a Python/Java side emitted a mapping URN the Go runner doesn't support; SDK version skew between pipeline authoring and worker; custom windowing strategies not registered in Go.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at sdks/go/pkg/beam/core/runtime/exec/translate.go:316

	case graphx.URNWindowMappingSliding:
		var payload pipepb.SlidingWindowsPayload
		if err := proto.Unmarshal(wmfn.GetPayload(), &payload); err != nil {
			return nil, err
		}
		periodPB := payload.GetPeriod()
		if err := periodPB.CheckValid(); err != nil {
			return nil, err
		}
		period := periodPB.AsDuration()

		sizePB := payload.GetSize()
		if err := sizePB.CheckValid(); err != nil {
			return nil, err
		}
		size := sizePB.AsDuration()
		return &windowMapper{wfn: window.NewSlidingWindows(period, size)}, nil
	default:
		return nil, fmt.Errorf("unsupported window mapping fn URN %v", urn)
	}
}

func (b *builder) makePCollections(out []string) ([]Node, error) {
	var ret []Node
	for _, o := range out {
		n, err := b.makePCollection(o)
		if err != nil {
			return nil, err
		}
		// This is the cleanest place to do this check and filtering,
		// since DataSinks don't know their inputs, due to the construction
		// call stack.
		// A Source->Sink is both uncommon and inefficent, with the Source eliding the
		// collection anyway.
		// TODO[BEAM-6374): Properly handle the multiplex and flatten cases.
		// Right now we just stop datasink collection.
		switch out := n.Out.(type) {

View on GitHub (pinned to 12126d8942)