flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Hueske <fhue...@gmail.com>
Subject Re: WindowedStream aggregation methods pre-aggregate?
Date Fri, 27 May 2016 23:02:54 GMT
Hi Elias,

yes, reduce, fold, and the aggregation functions (sum, min, max, minBy,
maxBy) on WindowedStream preform eager aggregation, i.e., the functions are
apply for each value that enters the window and the state of the window
will consist of a single value. In case you need access to the Window
object (e.g., to include the start or end time), there are overloaded
versions of apply that take a ReduceFunction or FoldFunction and an
additional WindowFunction. These versions eagerly apply the Reduce or
FoldFunction and finally the WindowFunction when the window is closed on
the aggregated value (the iterator will serve a single value).

Cheers, Fabian

2016-05-28 0:48 GMT+02:00 Elias Levy <fearsome.lucidity@gmail.com>:

> Can someone confirm whether
> the org.apache.flink.streaming.api.scala.WindowedStream methods other than
> "apply" (e.g. "sum") perform pre-aggregation?  The API docs are silent on
> this.
>
>
>

Mime
View raw message