Re: Stashing key with AggregateFunction

2018-05-06 Thread Fabian Hueske
Hi Ken, Thanks for the bug report! Fabian 2018-05-05 0:46 GMT+02:00 Ken Krugler : > Hi Fabian & Stefan, > > Thanks, and yes that does work more like what I’d expect. > > Regards, > > — Ken > > PS - Just FYI the Java code examples in the documentation referenced below > have a number of bugs, se

Re: Stashing key with AggregateFunction

2018-05-04 Thread Ken Krugler
Hi Fabian & Stefan, Thanks, and yes that does work more like what I’d expect. Regards, — Ken PS - Just FYI the Java code examples in the documentation referenced below have a number of bugs, see FLINK-9299 . > On May 4, 2018, at 7:35 AM, Fab

Re: Stashing key with AggregateFunction

2018-05-04 Thread Fabian Hueske
Hi Ken, You can also use an additional ProcessWindowFunction [1] that is applied on the result of the AggregateFunction to set the key. Since the PWF is only applied on the final result, there no overhead (actually, it might even be slightly cheaper because the AggregateFunction can be simpler).

Re: Stashing key with AggregateFunction

2018-05-04 Thread Stefan Richter
Hi, I have two possible options to achieve this. The first option is that you could obviously always derive the key again from the input of the aggregate function. The second option is combining an AggregateFunction with a ProcessWindowFunction. With the second solution you get incremental aggr

Stashing key with AggregateFunction

2018-05-03 Thread Ken Krugler
Hi list, I was trying different ways to implement a moving average (count based, not time based). The blunt instrument approach is to create a custom FlatMapFunction that keeps track of the last N values. It seemed like using an AggregateFunction would be most consistent with the Flink API, a