[jira] [Created] (FLINK-6108) Add sum(fieldName) to sum based on named POJO fields

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-6108) Add sum(fieldName) to sum based on named POJO fields

Shang Yuanchun (Jira)
Luke Hutchison created FLINK-6108:
-------------------------------------

             Summary: 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: Bug
          Components: Core
    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)