You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Sachin Mittal <sj...@gmail.com> on 2024/04/10 14:54:42 UTC

How are window's boundaries decided in flink

Hi,
Lets say I have defined 1 minute TumblingEventTimeWindows.
So it will create windows as:
(0, 60), (60, 120), ....

Now lets say I have an event at time t = 60.
In which window would this get aggregated ?
1st or second or both.

Say I want this to get aggregated only in the second window, how can I
achieve this ?


Thanks
Sachin

Re: How are window's boundaries decided in flink

Posted by Dylan Fontana via user <us...@flink.apache.org>.
Hi Sachin,

Assignment for tumbling windows is exclusive on the endTime; see
description here
https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/dev/datastream/operators/windows/#tumbling-windows
.

So in your example it would be assigned to window (60, 120) as in reality
the windows would actually be constructed like:
- (0, 59)
- (60 - 119)

Hope this helps,
Dylan

On Wed, Apr 10, 2024 at 10:56 AM Sachin Mittal <sj...@gmail.com> wrote:

> Hi,
> Lets say I have defined 1 minute TumblingEventTimeWindows.
> So it will create windows as:
> (0, 60), (60, 120), ....
>
> Now lets say I have an event at time t = 60.
> In which window would this get aggregated ?
> 1st or second or both.
>
> Say I want this to get aggregated only in the second window, how can I
> achieve this ?
>
>
> Thanks
> Sachin
>
>