damccorm opened a new pull request, #17374: URL: https://github.com/apache/beam/pull/17374
**Summary of Changes** This pr is a continuation of building watermark support in the Go Sdk. It builds on the work done in https://github.com/apache/beam/pull/17267 and introduces the ability for watermark estimators to have state that is persisted through splits. It includes the following changes: - Validation (graph/fn.go) - Code generation (genx/genx.go) - Execution (exec/sdf.go and exec/sdf_invokers.go) - Encoding changes (pardo.go) This is built according to the design specified here - https://docs.google.com/document/d/1DqCYJ-J1YGNelCRIcN5v6BQsZxJB2l5uWBmN4ti--Ew/edit?usp=sharing **Next Steps** This work does not attempt any of the following (though it is built in such a way that those should be cleanly supported in subsequent PRs): - Manual estimators (passed into ProcessElement) - Timestamp observing estimators (call ObserveTimestamp on each emitted timestamp) - Doc changes - ProcessContinuation support (because ProcessContinuations don't exist in the Go Sdk yet) **Manual Testing** On top of all the unit tests introduced, I hacked the existing textio sdf doFn and added the following function: ``` type DannysEstimator struct { state time.Time } func (e *DannysEstimator) CurrentWatermark() time.Time { return e.state } func (fn *readSdfFn) GetInitialWatermarkEstimatorState(_ beam.EventTime, _ offsetrange.Restriction, _ string, _ int64) time.Time { // Return some watermark state return time.Now() } func (fn *readSdfFn) CreateWatermarkEstimator(initialState time.Time) *DannysEstimator { return &DannysEstimator{state: initialState} } func (fn *readSdfFn) GetWatermarkEstimatorState(e *DannysEstimator) time.Time { state := e.state return state.Add(7 * 24 * time.Hour) } ``` and ran wordCount (with the textio sdf version) on dataflow so that I could observe the output watermark was getting correctly updated to the current wall clock time, and then was getting updated repeatedly on splits. Since I kept adding 7 days to the state every time we split, it eventually got to June: <img width="459" alt="image" src="https://user-images.githubusercontent.com/42773683/163442776-15a1e681-9c98-4028-b970-94d9e6b9b6f2.png"> ------------------------ Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`). - [x] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue. - [ ] Update `CHANGES.md` with noteworthy changes. - [x] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier). To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md) GitHub Actions Tests Status (on master branch) ------------------------------------------------------------------------------------------------ [](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule) [](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule) [](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule) See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
