apache/beam · error
inputs parameters must precede emit function parameters
Error message
inputs parameters must precede emit function parameters
What it means
Sentinel error errInputPrecedence from the funcx parameter-ordering state machine: an input-side parameter kind (FnValue, FnIter, or FnReIter — side inputs and iterables) appeared after the state machine had already transitioned to the output/emit phase (FnEmit). Input parameters must all precede any emit-function parameters in a DoFn signature.
Solutions
- Reorder the signature so all side inputs (func(T), func(*T) bool, func(*T,*U) bool, etc.) come before any emit function parameters
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at sdks/go/pkg/beam/core/funcx/fn.go:539 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/22e6ae6698224738.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/go/pkg/beam/core/funcx/fn.go:539
if retState, err = nextRetState(retState, r.Kind); err != nil {
return errors.WithContextf(err, "validating return value %d for %s", i, u.Fn.Name())
}
}
return nil
}
var (
errContextParam = errors.New("may only have a single context.Context parameter and it must be the first parameter")
errPaneParamPrecedence = errors.New("may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter")
errWindowParamPrecedence = errors.New("may only have a single Window parameter and it must precede the EventTime and main input parameter")
errEventTimeParamPrecedence = errors.New("may only have a single beam.EventTime parameter and it must precede the main input parameter")
errWatermarkEstimatorParamPrecedence = errors.New("may only have a single sdf.WatermarkEstimator parameter and it must precede the main input parameter")
errReflectTypePrecedence = errors.New("may only have a single reflect.Type parameter and it must precede the main input parameter")
errRTrackerPrecedence = errors.New("may only have a single sdf.RTracker parameter and it must precede the main input parameter")
errBundleFinalizationPrecedence = errors.New("may only have a single BundleFinalization parameter and it must precede the main input parameter")
errStateProviderPrecedence = errors.New("may only have a single state.Provider parameter and it must precede the main input parameter")
errTimerProviderPrecedence = errors.New("may only have a single timer.Provider parameter and it must precede the main input parameter")
errInputPrecedence = errors.New("inputs parameters must precede emit function parameters")
)
type paramState int
const (
psStart paramState = iota
psContext
psPane
psWindow
psEventTime
psWatermarkEstimator
psType
psInput
psOutput
psRTracker
psBundleFinalization
psStateProvider
psTimerProviderView on GitHub (pinned to 12126d8942)