Hi Marcus,

I think that is an expected result for sliding window in Flink. You can see
the example in the document for more details. [1]
For your need, I will suggest to use ProcessFunction to implement the
sliding window that you expected. You can use key state to buffer elements
and onTimer to trigger each window, and all these will be done on each key.
[2]

Best Regards,
Tony Wei
[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/windows.html#sliding-windows
[2]
https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/stream/process_function.html#example


2017-10-11 1:52 GMT+08:00 mclendenin <marcusc...@gmail.com>:

> Sure, I'm going to use a name as key in this example and just a number as
> the
> value aggregated. This is the sample input data
>
> 12:00
> {"name": "Marcus", "value": 1}
> 12:01
> {"name": "Suzy", "value": 2}
> 12:03
> {"name": "Alicia", "value": 3}
> 12:04
> {"name": "Ben", "value": 1}
> 12:06
> {"name": "Alicia", "value": 1}
> {"name": "Ben", "value": 5}
>
> Expected Result in output
> 12:05
> {"name": "Marcus", "total": 1}
> 12:06
> {"name": "Suzy", "value": 2}
> 12:08
> {"name": "Alicia", "value": 4}
> 12:09
> {"name": "Ben", "value": 6}
>
> Actual Result in output
> 12:05
> {"name": "Marcus", "value": 1}
> {"name": "Suzy", "value": 2}
> {"name": "Alicia", "value": 3}
> {"name": "Ben", "value": 1}
> 12:10
> {"name": "Marcus", "value": 1}
> {"name": "Suzy", "value": 2}
> {"name": "Alicia", "value": 4}
> {"name": "Ben", "value": 6}
>
>
>
> --
> Sent from: http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/
>

Reply via email to