{"record":{"id":"029849e98c9a25f0","repo":"apache/beam","slug":"may-only-have-a-single-sdf-watermarkestimator-parameter-and","errorCode":null,"errorMessage":"may only have a single sdf.WatermarkEstimator parameter and it must precede the main input parameter","messagePattern":"may only have a single sdf\\.WatermarkEstimator parameter and it must precede the main input parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/funcx/fn.go","lineNumber":533,"sourceCode":"\t\t\treturn errors.WithContextf(err, \"validating parameter %d for %s\", i, u.Fn.Name())\n\t\t}\n\t}\n\t// Validate the return value ordering.\n\tretState := rsStart\n\tfor i, r := range u.Ret {\n\t\tif retState, err = nextRetState(retState, r.Kind); err != nil {\n\t\t\treturn errors.WithContextf(err, \"validating return value %d for %s\", i, u.Fn.Name())\n\t\t}\n\t}\n\treturn nil\n}\n\nvar (\n\terrContextParam                      = errors.New(\"may only have a single context.Context parameter and it must be the first parameter\")\n\terrPaneParamPrecedence               = errors.New(\"may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter\")\n\terrWindowParamPrecedence             = errors.New(\"may only have a single Window parameter and it must precede the EventTime and main input parameter\")\n\terrEventTimeParamPrecedence          = errors.New(\"may only have a single beam.EventTime parameter and it must precede the main input parameter\")\n\terrWatermarkEstimatorParamPrecedence = errors.New(\"may only have a single sdf.WatermarkEstimator parameter and it must precede the main input parameter\")\n\terrReflectTypePrecedence             = errors.New(\"may only have a single reflect.Type parameter and it must precede the main input parameter\")\n\terrRTrackerPrecedence                = errors.New(\"may only have a single sdf.RTracker parameter and it must precede the main input parameter\")\n\terrBundleFinalizationPrecedence      = errors.New(\"may only have a single BundleFinalization parameter and it must precede the main input parameter\")\n\terrStateProviderPrecedence           = errors.New(\"may only have a single state.Provider parameter and it must precede the main input parameter\")\n\terrTimerProviderPrecedence           = errors.New(\"may only have a single timer.Provider parameter and it must precede the main input parameter\")\n\terrInputPrecedence                   = errors.New(\"inputs parameters must precede emit function parameters\")\n)\n\ntype paramState int\n\nconst (\n\tpsStart paramState = iota\n\tpsContext\n\tpsPane\n\tpsWindow\n\tpsEventTime\n\tpsWatermarkEstimator\n\tpsType","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/funcx/fn.go#L515-L551","documentation":"Sentinel error errWatermarkEstimatorParamPrecedence returned by the funcx parameter-ordering state machine (nextParamState) when validating a DoFn's signature. A sdf.WatermarkEstimator parameter appeared after the main input parameter or more than one was present; Beam requires the watermark estimator (if used) to be a single parameter preceding the main element input.","triggerScenarios":"Thrown at sdks/go/pkg/beam/core/funcx/fn.go:533 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the sdf.WatermarkEstimator parameter before the main input parameter in the DoFn method signature","Remove the duplicate watermark estimator parameter so at most one exists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}