Hi, this is a known bug: https://issues.apache.org/jira/browse/FLINK-3869.
I'm still hoping that we can get a workaround in for Flink 1.2. See my last comment in the Jira Issue. Cheers, Aljoscha On Mon, 14 Nov 2016 at 14:49 Stephan Epping <stephan.epp...@zweitag.de> wrote: > Hello, > > I wondered if there is a particular reason for the window function to have > explicitly the same input/output type? > > public <R> SingleOutputStreamOperator<R> apply(R initialValue, > FoldFunction<T, R> foldFunction, WindowFunction<R, R, K, W> function) > > for example (the following does not work): > > DataStream<SensorAggregatedValue> aggregates = values > .assignTimestampsAndWatermarks(new > SensorTimestampsAndWatermarks()) > .keyBy("id") > .timeWindow(Time.minutes(1)) > .apply(new SensorValueAccumulator(), new > AccumulateSensorValues(), new AggregateSensorValues()); > > because in this case my accumulator object does not have any id or > timestamp information - just count, sum, min, max etc. And finally in the > window function I receive the key (sensorId) and time window (start/end) > and can build an aggregated value with all information needed. But > currently the apply function forces me to use one cluttered class with id, > count, sum, …, where the id,start,end time are invalid during the fold > function. > > kind regards, > Stephan >