Hello! This is not possible in a simple way, because of the main fact: windows are processed simultaneously.
Many windows may have some state and incoming data at the same time, even if the time ranges of your windows do not overlap. So, sharing state across windows would need concurrency control (potentially distributed concurrency control) or it would need to wait for all data to arrive and then sort it. Beam state is designed to avoid this, so that it can scale up efficiently. If you want to have some running accumulator that processes some data in order, there may be a way to express it, for example there is a @RequiresTimeSortedInput annotation that sometimes can handle it. Can you share more about your use case? Kenn On Fri, May 2, 2025 at 9:03 AM Shaochen Bai <shaoc...@kisi.io> wrote: > Hello, > > I read that in stateful processing > <https://beam.apache.org/blog/stateful-processing/> with Apache Beam, *“a > state cell is scoped to a key+window pair.”* What if I want to maintain a > persistent state *across* windows? Is there a workaround for this, and > what are the common practices in such cases? > > Thanks! > > Best, > Shaochen > > > > > --- > This email is confidential/privileged. If you're not the intended > recipient, please delete it and notify us immediately; please do not > copy/use/disclose it for any purpose, to anyone. Thank you! >