apache/beam · error

unsupported window type

Error message

unsupported window type: %v

What it means

unmarshalWindowFn converts a windowing strategy's window-function URN into a Beam Go window_fn. Only known types (global, sessions, fixed, sliding, custom) are supported; any other URN hits the default branch and returns this error.

Solutions

  1. Use a supported window type (global windows, fixed, sliding, sessions, or a registered custom window fn)
  2. Upgrade the Beam Go SDK so it recognizes the runner's window URN
  3. Verify the windowing strategy emitted by your pipeline construction (graphx.NewWindowingStrategy) uses a known URN
Defensive patterns

Strategy: validation

Validate before calling

// Verify window URN is supported before submitting
supported := map[string]bool{"beam:window:fn:global_windows:v1": true, "beam:window:fn:fixed_windows:v1": true, "beam:window:fn:sliding_windows:v1": true, "beam:window:fn:session_windows:v1": true}
if !supported[windowFnUrn] {
    return fmt.Errorf("unsupported window fn: %s", windowFnUrn)
}

Try / catch

if err := buildPlan(desc); err != nil {
    if strings.Contains(err.Error(), "unsupported window type") {
        // fall back to a supported windowing strategy or upgrade SDK
    }
}

Prevention

When it happens

Trigger: A pipeline description references a windowFn URN not in the switch (e.g. a newer runner-only window type or misspelled URN), during makeLink/unmarshalWindowFn.

Common situations: Using a runner or SDK version that emits window types the Go SDK doesn't understand; custom windowing from other-language SDKs ported into a Go harness; typo'd URNs in generated pipelines.

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/66b5c659d513ab4e. Report an issue: GitHub.

Appendix: source

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

		}
		size := sizePB.AsDuration()

		return window.NewSlidingWindows(period, size), nil

	case graphx.URNSessionsWindowFn:
		var payload pipepb.SessionWindowsPayload
		if err := proto.Unmarshal(wfn.GetPayload(), &payload); err != nil {
			return nil, err
		}
		gapPB := payload.GetGapSize()
		if err := gapPB.CheckValid(); err != nil {
			return nil, err
		}
		gap := gapPB.AsDuration()
		return window.NewSessions(gap), nil

	default:
		return nil, errors.Errorf("unsupported window type: %v", urn)
	}
}

func unmarshalAndMakeWindowMapping(wmfn *pipepb.FunctionSpec) (WindowMapper, error) {
	switch urn := wmfn.GetUrn(); urn {
	case graphx.URNWindowMappingGlobal:
		return &windowMapper{wfn: window.NewGlobalWindows()}, nil
	case graphx.URNWindowMappingFixed:
		var payload pipepb.FixedWindowsPayload
		if err := proto.Unmarshal(wmfn.GetPayload(), &payload); err != nil {
			return nil, err
		}
		sizePB := payload.GetSize()
		if err := sizePB.CheckValid(); err != nil {
			return nil, err
		}
		size := sizePB.AsDuration()
		return &windowMapper{wfn: window.NewFixedWindows(size)}, nil

View on GitHub (pinned to 12126d8942)