Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/1585#discussion_r51993427 --- Diff: flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/SortPartitionITCase.java --- @@ -197,6 +198,58 @@ public void testSortPartitionParallelismChange() throws Exception { compareResultAsText(result, expected); } + @Test + public void testSortPartitionWithKeySelector1() throws Exception { + /* + * Test sort partition on an extracted key + */ + + final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); + env.setParallelism(4); + + DataSet<Tuple3<Integer, Long, String>> ds = CollectionDataSets.get3TupleDataSet(env); + List<Tuple1<Boolean>> result = ds + .map(new IdMapper<Tuple3<Integer, Long, String>>()).setParallelism(4) // parallelize input + .sortPartition(new KeySelector<Tuple3<Integer, Long, String>, Integer>() { + @Override + public Integer getKey(Tuple3<Integer, Long, String> value) throws Exception { + return value.f0; --- End diff -- return some other field than `f0`.
--- 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. ---