{"record":{"id":"1fbc8b5c1b666e52","repo":"apache/beam","slug":"iterators-with-timestamp-values-et-v-and-et-k-v-are-not","errorCode":null,"errorMessage":"Iterators with timestamp values (<ET,V> and <ET, K, V>) are not valid, as side input time stamps are not preserved after windowing. See https://github.com/apache/beam/issues/22404 for more information.","messagePattern":"Iterators with timestamp values \\(<ET,V> and <ET, K, V>\\) are not valid, as side input time stamps are not preserved after windowing\\. See https://github\\.com/apache/beam/issues/22404 for more information\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/funcx/sideinput.go","lineNumber":84,"sourceCode":"\treturn types, ok\n}\n\nfunc unfoldIter(t reflect.Type) ([]reflect.Type, bool, error) {\n\tif t.Kind() != reflect.Func {\n\t\treturn nil, false, nil\n\t}\n\n\tif t.NumOut() != 1 || t.Out(0) != reflectx.Bool {\n\t\treturn nil, false, nil\n\t}\n\tif t.NumIn() == 0 {\n\t\treturn nil, false, nil\n\t}\n\n\tvar ret []reflect.Type\n\tskip := 0\n\tif t.In(0).Kind() == reflect.Ptr && t.In(0).Elem() == typex.EventTimeType {\n\t\treturn nil, false, errors.New(errIllegalEventTimeInIter)\n\t}\n\tif t.NumIn()-skip > 2 || t.NumIn() == skip {\n\t\treturn nil, false, nil\n\t}\n\n\tfor i := skip; i < t.NumIn(); i++ {\n\t\tif ok, err := isOutParam(t.In(i)); !ok {\n\t\t\treturn nil, false, errors.Wrap(err, errIllegalParametersInIter)\n\t\t}\n\t\tif reflect.TypeOf((*any)(nil)).Elem() == t.In(i).Elem() && !typex.IsUniversal(t.In(i)) {\n\t\t\treturn nil, false, errors.New(\"Type interface{} isn't a supported PCollection type\")\n\t\t}\n\t\tret = append(ret, t.In(i).Elem())\n\t}\n\treturn ret, true, nil\n}\n\nfunc isOutParam(t reflect.Type) (bool, error) {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/funcx/sideinput.go#L66-L102","documentation":"Beam Go rejects side-input iterator signatures whose first parameter is an EventTime (a `<ET,...>` style signature). Side input timestamps are not preserved after windowing, so an event-time-carrying iterator would silently give wrong times; the SDK forbids it outright (errIllegalEventTimeInIter), referencing beam issue #22404.","triggerScenarios":"Declaring a DoFn ProcessElement whose side-input parameter is `func(reflect chan/iter ...)` with a leading `typex.EventTime` pointer parameter — e.g. `ProcessElement(et typex.EventTime, ...)` combined with an iterator `func(*func(et typex.EventTime, v T) bool)` produced when the first In(0) is a Ptr to EventTimeType.","commonSituations":"Developers porting Java/Python Beam `<ET,V>` side input patterns to Go, or expecting side input timestamps to survive GBK/windowing, then writing iterators with event-time first parameters.","solutions":["Remove the EventTime parameter from the side-input iterator signature; iterate values only (e.g. `func(v V) bool`).","If timestamps are needed, encode the timestamp into the value (KV<Timestamp,V>) before the side input is created.","Use a main-input parameter for event time (main inputs preserve timestamps) rather than a side input.","Track https://github.com/apache/beam/issues/22404 for possible future support."],"exampleFix":"// before\nfunc (fn *f) ProcessElement(s beamutil.SideInputIter func(typex.EventTime, string) bool) {}\n// after\nfunc (fn *f) ProcessElement(s beamutil.SideInputIter func(string) bool) {}","handlingStrategy":"validation","validationCode":"func iterHasEventTimeFirst(fn reflect.Type) bool {\n    if fn.NumIn() == 0 { return false }\n    in0 := fn.In(0)\n    return in0.Kind() == reflect.Ptr && in0.Elem() == reflect.TypeOf(typex.EventTime(0))\n}","typeGuard":"func isEventTime(t reflect.Type) bool { return t == reflect.TypeOf(typex.EventTime(0)) }","tryCatchPattern":null,"preventionTips":["Never include typex.EventTime in side-input iterator signatures; only in main input parameters.","Encode needed timestamps into the value (KV<Timestamp,V>) for side inputs.","Follow beam issue #22404 before attempting ET side-input patterns."],"tags":["go","beam","side-input","event-time"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}