flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xingcan Cui <xingc...@gmail.com>
Subject Re: Sliding Window - Weird behaviour
Date Thu, 13 Apr 2017 10:19:21 GMT
​Hi harish,

I will not argue for the correctness of the result​s, but just tell you why
this happens.

The countWindow(2, 1) can be regarded as two separate processes: 1)
maintain a window whose size *not exceeds* 2 and 2) trigger window
evaluation every single record.

Actually, in Flink the two processes execute independently and that's why
the first record 1 triggered window accumulation in you example.

Hope this helps,
Xingcan

On Thu, Apr 13, 2017 at 4:43 PM, madhairsilence <harish.kumard@tcs.com>
wrote:

> I have a datastream
> 1,2,3,4,5,6,7....
>
> I applied a sliding countWindow as
> inputStream.keyBy("num").countWindow(2,1)
>
> I expect an output as
> 1,2
> 2,3
> 3,4
>
> But am getting an output as
> 1
> 1,2
> 2,3
> 3,4
>
> Why does the data slide first and then accumulate the window size
>
>
>
> --
> View this message in context: http://apache-flink-mailing-
> list-archive.1008284.n3.nabble.com/Sliding-Window-
> Weird-behaviour-tp17013.html
> Sent from the Apache Flink Mailing List archive. mailing list archive at
> Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message