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

    https://github.com/apache/flink/pull/1553#discussion_r53153472
  
    --- Diff: 
flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/GroupReduceITCase.java
 ---
    @@ -434,6 +431,95 @@ public void 
testCorrectnessOfGroupreduceWithDescendingGroupSort() throws Excepti
        }
     
        @Test
    +   public void 
testCorrectnessOfGroupreduceWithExplicitPartitionOfReducer() throws Exception {
    +           /*
    +            * check correctness of groupReduce with descending group sort
    +            */
    +           final ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
    +           env.setParallelism(1);
    +
    +           DataSet<String> ds = CollectionDataSets.getStringDataSet(env);
    +
    +           DataSet<Tuple2<String, Integer>> counts =
    +                   // split up the lines in pairs (2-tuples) containing: 
(word,1)
    +                   ds.flatMap(new Tokenizer()).partitionByHash(0)
    +                           // group by the tuple field "0" and sum up 
tuple field "1"
    +                           .groupBy(0)
    +                           .sum(1);
    +
    +           List<Tuple2<String, Integer>> result = counts.collect();
    +           String expected = "am,1\n"
    +                   +
    +                   "are,1\n" +
    +                   "comment,1\n" +
    +                   "fine,1\n" +
    +                   "hello,3\n" +
    +                   "hi,1\n"+
    +                   "how,1\n"+
    +                   "i,1\n"+
    +                   "lol,1\n"+
    +                   "luke,1\n"+
    +                   "random,1\n"+
    +                   "skywalker,1\n"+
    +                   "world,2\n"+
    +                   "you,1\n";
    +
    +           compareResultAsTuples(result, expected);
    +   }
    +
    +   @Test
    +   public void 
testCorrectnessOfGroupreduceWithoutExplicitPartitionOfReducer() throws 
Exception {
    +           /*
    +            * check correctness of groupReduce with descending group sort
    +            */
    +           final ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
    +           env.setParallelism(1);
    --- End diff --
    
    No parallelism of `1` and a custom `GroupReduceFunction` with 
`GroupCombineFunction` interface.


---
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