Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1462#discussion_r47921105
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/DataSet.java 
---
    @@ -394,6 +396,21 @@ public long count() throws Exception {
                return res.<Long> getAccumulatorResult(id);
        }
     
    +   /**
    +    * Convenience method to get the count (number of elements) of a DataSet
    +    * as well as the checksum (sum over element hashes).
    +    *
    +    * @return A Checksum that represents the count and checksum of 
elements in the data set.
    +    */
    +   public Checksum checksum() throws Exception {
    +           final String id = new AbstractID().toString();
    +
    +           flatMap(new Utils.ChecksumHelper<T>(id)).name("checksum()")
    +                           .output(new 
DiscardingOutputFormat<NullValue>()).name("checksum() sink");
    --- End diff --
    
    Saves one operator and source of confusion in the UI. Actually, the 
`collect()` and `count()` should be similarly simplified, come to think of it 
;-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to