flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Hogan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLINK-6108) Add sum(fieldName) to sum based on named POJO fields
Date Sat, 18 Mar 2017 12:28:41 GMT

     [ https://issues.apache.org/jira/browse/FLINK-6108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Greg Hogan updated FLINK-6108:
    Issue Type: New Feature  (was: Bug)

> 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

View raw message