Window function - iterator data

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

Window function - iterator data

Paul Joireman

When you are using a window function the docs:


https://ci.apache.org/projects/flink/flink-docs-master/apis/streaming/windows.html#windowfunction---the-generic-case


state that


WindowFunction gets an Iterable containing all the elements of the window being processed


If the input data stream is timestamped using event times where the events can come in out of chronological order, are the events returned by the interator the same order as they were added?  Or does the window sort them internally on timestamp and return them through the iterator in timestamp chronological order?


Paul 

Reply | Threaded
Open this post in threaded view
|

Re: Window function - iterator data

Kostas Kloudas
Hi Paul,

Elements are returned in the order they were added in the window.
No sorting on timestamp is performed.

Hope this helps,
Kostas

On Aug 9, 2016, at 10:22 PM, Paul Joireman <[hidden email]> wrote:

When you are using a window function the docs:


state that

WindowFunction gets an Iterable containing all the elements of the window being processed

If the input data stream is timestamped using event times where the events can come in out of chronological order, are the events returned by the interator the same order as they were added?  Or does the window sort them internally on timestamp and return them through the iterator in timestamp chronological order?

Paul 

Reply | Threaded
Open this post in threaded view
|

Re: Window function - iterator data

Aljoscha Krettek
Hi,
Kostas is right in that the elements are never explicitly sorted by timestamp. In some cases they might not even be iterated in the order that they were added so I would normally assume the order of the elements to be completely arbitrary.

Cheers,
Aljoscha

On Wed, 10 Aug 2016 at 09:44 Kostas Kloudas <[hidden email]> wrote:
Hi Paul,

Elements are returned in the order they were added in the window.
No sorting on timestamp is performed.

Hope this helps,
Kostas

On Aug 9, 2016, at 10:22 PM, Paul Joireman <[hidden email]> wrote:

When you are using a window function the docs:


state that

WindowFunction gets an Iterable containing all the elements of the window being processed

If the input data stream is timestamped using event times where the events can come in out of chronological order, are the events returned by the interator the same order as they were added?  Or does the window sort them internally on timestamp and return them through the iterator in timestamp chronological order?

Paul