Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add set state in Go #22919

Merged
merged 4 commits into from
Aug 29, 2022
Merged

Add set state in Go #22919

merged 4 commits into from
Aug 29, 2022

Conversation

damccorm
Copy link
Contributor

@damccorm damccorm commented Aug 26, 2022

This continues to grow our state support by adding map state support. Once this is in, I'll add a follow up PR with an integration test. In the meantime, I tested manually by running the hacked wordcount found here - https://github.com/damccorm/beam/pull/96/files#diff-46f0bd8f9f6b541e840079960d684ba78e6513f1293b673d08faaec94d48a234 - and it produced output like:

swimming: false. Total num keys: 2. With keys: [swimming36 swimming]
hourly: false. Total num keys: 2. With keys: [hourly52 hourly]
hourly: true. Total num keys: 3. With keys: [hourly33 hourly52 hourly]
hourly: true. Total num keys: 4. With keys: [hourly52 hourly hourly1 hourly33]
About: false. Total num keys: 2. With keys: [About About38]
advise: false. Total num keys: 2. With keys: [advise18 advise]
advise: true. Total num keys: 3. With keys: [advise18 advise68 advise]
advise: true. Total num keys: 4. With keys: [advise68 advise18 advise4 advise]
lawful: false. Total num keys: 2. With keys: [lawful9 lawful]
lawful: true. Total num keys: 3. With keys: [lawful9 lawful lawful49]
lawful: true. Total num keys: 4. With keys: [lawful49 lawful38 lawful lawful9]

Note that this doesn't add support for Remove (to remove a single key). This will come in a future pr and has been noted in #22736

Part of #22736


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@github-actions github-actions bot added the go label Aug 26, 2022
@codecov
Copy link

codecov bot commented Aug 26, 2022

Codecov Report

Merging #22919 (260ec30) into master (0c82583) will decrease coverage by 0.00%.
The diff coverage is 53.17%.

@@            Coverage Diff             @@
##           master   #22919      +/-   ##
==========================================
- Coverage   73.69%   73.68%   -0.01%     
==========================================
  Files         713      713              
  Lines       94821    94930     +109     
==========================================
+ Hits        69874    69945      +71     
- Misses      23648    23684      +36     
- Partials     1299     1301       +2     
Flag Coverage Δ
go 51.00% <53.17%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/go/pkg/beam/core/graph/fn.go 84.54% <0.00%> (ø)
sdks/go/pkg/beam/core/runtime/exec/translate.go 12.72% <0.00%> (-0.22%) ⬇️
sdks/go/pkg/beam/core/runtime/graphx/translate.go 38.42% <0.00%> (-0.50%) ⬇️
sdks/go/pkg/beam/pardo.go 41.79% <0.00%> (-0.32%) ⬇️
sdks/go/pkg/beam/core/state/state.go 76.57% <80.72%> (+1.29%) ⬆️
...eam/runners/portability/fn_api_runner/execution.py 92.44% <0.00%> (-0.65%) ⬇️
sdks/python/apache_beam/runners/direct/executor.py 96.46% <0.00%> (-0.55%) ⬇️
sdks/python/apache_beam/transforms/util.py 96.22% <0.00%> (+0.15%) ⬆️
...ks/python/apache_beam/runners/worker/sdk_worker.py 89.09% <0.00%> (+0.15%) ⬆️
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@damccorm damccorm marked this pull request as ready for review August 26, 2022 19:07
@damccorm
Copy link
Contributor Author

R: @riteshghorse

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

sdks/go/pkg/beam/core/runtime/exec/translate.go Outdated Show resolved Hide resolved
sdks/go/pkg/beam/core/state/state_test.go Outdated Show resolved Hide resolved
sdks/go/pkg/beam/core/state/state_test.go Outdated Show resolved Hide resolved
damccorm and others added 3 commits August 29, 2022 10:36
Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>
Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>
@damccorm damccorm merged commit 4a66829 into apache:master Aug 29, 2022
@damccorm damccorm deleted the users/damccorm/setState branch August 29, 2022 15:10
dedocibula pushed a commit to dedocibula/beam that referenced this pull request Sep 15, 2022
* Add set state in Go

* Update sdks/go/pkg/beam/core/state/state_test.go

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>

* Update sdks/go/pkg/beam/core/state/state_test.go

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>

* Remove unneccessary conversion

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>
kkdoon pushed a commit to twitter-forks/beam that referenced this pull request Sep 29, 2022
* Add set state in Go

* Update sdks/go/pkg/beam/core/state/state_test.go

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>

* Update sdks/go/pkg/beam/core/state/state_test.go

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>

* Remove unneccessary conversion

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>
cushon pushed a commit to cushon/beam that referenced this pull request Oct 17, 2022
* Add set state in Go

* Update sdks/go/pkg/beam/core/state/state_test.go

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>

* Update sdks/go/pkg/beam/core/state/state_test.go

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>

* Remove unneccessary conversion

Co-authored-by: Ritesh Ghorse <riteshghorse@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants