recipes icon indicating copy to clipboard operation
recipes copied to clipboard

State Management

Open sandeep540 opened this issue 2 years ago • 3 comments

it's a great playbook for some starting flink, nice examples

1-2 examples explaining basic state management would be great

sandeep540 avatar Aug 09 '22 09:08 sandeep540

Do you have a specific use-case in mind?

zentol avatar Aug 09 '22 13:08 zentol

It can be simple aggregate function with sum/count of events! If I get some time over this weekend, will try to raise a PR myself, it will be learning for me as well

sandeep540 avatar Aug 10 '22 05:08 sandeep540

It can be simple aggregate function with sum/count of events!

I'm not sure if that makes sense as a recipe, because the answer to such a use-case is using the built-in aggregate/reduce mechanism of Flink which handles state on it's own under the hood, like in the Session Windows recipe. We'd like to avoid recipes where the way they are solving the problem isn't quite the appropriate means to do so, even if it would work and show-case how a feature could be used.

The Serializing Timestamped Data recipe shows how to use a ValueState, and a simple aggregate use-case wouldn't go much further than that I believe.

will try to raise a PR myself

Please be aware that we don't accept PR contributions, as described in the CONTRIBUTING.md.

zentol avatar Aug 10 '22 06:08 zentol