flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kostas Kloudas <k.klou...@data-artisans.com>
Subject Re: If I chain two windows, what event-time would the second window have?
Date Wed, 27 Jul 2016 11:09:18 GMT
Hi Yassine,

When the WindowFunction is applied to the content of a window, the timestamp of the resulting
is the window.maxTimestamp, which is the endOfWindow-1.

You can imaging if you have a Tumbling window from 0 to 2000, the result will have a timestamp
of 1999.
Window boundaries are closed in the start and open at the end timestamp, or [start, end).

If you want to play around, I would suggest checking out the tests in the WindowOperatorTest

There you can do experiments and figure out how Flinkā€™s windowOperator works internally
and what is the 
interplay between windowAssingers, triggers, and the windowOperator.

Hope this helps,

> On Jul 27, 2016, at 8:41 AM, Yassin Marzouki <yassmarzou@gmail.com> wrote:
> Hi all,
> Say I assign timestamps to a stream and then apply a transformation like this:
> stream.keyBy(0).timeWindow(Time.hours(5)).reduce(count).timeWindowAll(Time.days(1)).apply(transformation)
> Now, when the first window is applied, events are aggregated based on their timestamps,
but I don't understand what timestamp will be assigned to the aggregated result of the reduce
operation for the second window to process it. Could you please explain it? Thank you.
> Best,
> Yassine

View raw message