flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aljoscha Krettek <aljos...@apache.org>
Subject Re: apply with fold- and window function
Date Mon, 14 Nov 2016 14:34:40 GMT
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.


On Mon, 14 Nov 2016 at 14:49 Stephan Epping <stephan.epping@zweitag.de>

> 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

View raw message