flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Hueske <fhue...@gmail.com>
Subject Re: Get DataSet sum
Date Tue, 28 Apr 2015 19:54:41 GMT
You can also use Reduce to compute a sum on any data type (e.g., an Integer
field in a POJO).

2015-04-28 15:25 GMT+02:00 Maximilian Michels <mxm@apache.org>:

> Hi Giacomo,
>
> If you have your data stored in a Tuple inside a DataSet, then a call to
> dataSet.sum(int field) should do it.
>
> See Aggregation under
> http://ci.apache.org/projects/flink/flink-docs-master/apis/programming_guide.html#transformations
>
> Best,
> Max
>
> On Tue, Apr 28, 2015 at 2:52 PM, Giacomo Licari <giacomo.licari@gmail.com>
> wrote:
>
>> Hi Guys,
>> how can obtain the sum of all items (integer or double) in a DataSet?
>>
>> Do I have to use Flink Iterators? And how?
>>
>> Thank you,
>> Giacomo
>>
>
>

Mime
View raw message