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

    https://github.com/apache/flink/pull/896#discussion_r34547975
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/DataSet.java 
---
    @@ -408,14 +408,16 @@ public long count() throws Exception {
                JobExecutionResult res = getExecutionEnvironment().execute();
     
                ArrayList<byte[]> accResult = res.getAccumulatorResult(id);
    -           try {
    -                   return 
SerializedListAccumulator.deserializeList(accResult, serializer);
    -           }
    -           catch (ClassNotFoundException e) {
    -                   throw new RuntimeException("Cannot find type class of 
collected data type.", e);
    -           }
    -           catch (IOException e) {
    -                   throw new RuntimeException("Serialization error while 
deserializing collected data", e);
    +           if (accResult != null) {
    +                   try {
    +                           return 
SerializedListAccumulator.deserializeList(accResult, serializer);
    +                   } catch (ClassNotFoundException e) {
    +                           throw new RuntimeException("Cannot find type 
class of collected data type.", e);
    +                   } catch (IOException e) {
    +                           throw new RuntimeException("Serialization error 
while deserializing collected data", e);
    +                   }
    +           } else {
    +                   throw new RuntimeException("The job result did not 
contain any accumulator data.");
    --- End diff --
    
    Then let's change it to
    > Collect returned no results.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to