What is the difference between RuntimeContext state and ProcessWindowFunction.Context state when using a ProcessWindowFunction?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the difference between RuntimeContext state and ProcessWindowFunction.Context state when using a ProcessWindowFunction?

Marco Villalobos-2
Hi,

I am having a difficult time distinguishing the difference between RuntimeContext state and global state when using a ProcessWindowFunction.

A ProcessWindowFunction has three access different kinds of state.
1. RuntimeContext state.
2. ProcessWindowFunction.Context global state
3. ProcessWindowFunction.Context window state.

It's clear to me that the window state belongs to a window, the lines seemed a bit blurred between RuntimeContext state and ProcessWindowFunction.Context global state.

Can somebody please elaborate on the differences, and when I should use global state vs runtime context state?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between RuntimeContext state and ProcessWindowFunction.Context state when using a ProcessWindowFunction?

Arvid Heise-4
Hi Marco,

1. RuntimeContext is available to all operators and is bound to the current key (if used in a keyed context).
2. Is the same actually. Not sure why it's exposed twice... So use either one.
3. Is additionally bound to the current window.

On Tue, Feb 9, 2021 at 10:46 PM Marco Villalobos <[hidden email]> wrote:
Hi,

I am having a difficult time distinguishing the difference between RuntimeContext state and global state when using a ProcessWindowFunction.

A ProcessWindowFunction has three access different kinds of state.
1. RuntimeContext state.
2. ProcessWindowFunction.Context global state
3. ProcessWindowFunction.Context window state.

It's clear to me that the window state belongs to a window, the lines seemed a bit blurred between RuntimeContext state and ProcessWindowFunction.Context global state.

Can somebody please elaborate on the differences, and when I should use global state vs runtime context state?

Thank you.