You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Greg Hogan (JIRA)" <ji...@apache.org> on 2017/03/18 12:36:41 UTC
[jira] [Closed] (FLINK-6108) Add sum(fieldName) to sum based on
named POJO fields
[ https://issues.apache.org/jira/browse/FLINK-6108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Hogan closed FLINK-6108.
-----------------------------
Resolution: Duplicate
> Add sum(fieldName) to sum based on named POJO fields
> ----------------------------------------------------
>
> Key: FLINK-6108
> URL: https://issues.apache.org/jira/browse/FLINK-6108
> Project: Flink
> Issue Type: New Feature
> Components: DataSet API
> Affects Versions: 1.2.0
> Reporter: Luke Hutchison
>
> Currently it is possible to do
> {code}
> dataSet.groupBy(0).sum(1)
> {code}
> but not
> {code}
> dataSet.groupBy("id").sum("count")
> {code}
> groupBy() takes named fields, but sum() does not, it only works with tuples. It would be great if sum() could take named fields too -- otherwise you have to map to tuples to make use of easy summing.
> (This would probably only work reliably with POJOs, since a new object instance would need to be constructed to take the field containing the sum.)
> Similarly, min(), max() etc. should also take named fields.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)