[ 
https://issues.apache.org/jira/browse/FLINK-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15138594#comment-15138594
 ] 

ASF GitHub Bot commented on FLINK-3234:
---------------------------------------

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

    https://github.com/apache/flink/pull/1585#discussion_r52282336
  
    --- 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>, Long>() {
    +                           @Override
    +                           public Long getKey(Tuple3<Integer, Long, 
String> value) throws Exception {
    +                                   return value.f1;
    +                           }
    +                   }, Order.DESCENDING)
    --- End diff --
    
    Change sort order to `ASCENDING` (or in the other test).


> SortPartition does not support KeySelectorFunctions
> ---------------------------------------------------
>
>                 Key: FLINK-3234
>                 URL: https://issues.apache.org/jira/browse/FLINK-3234
>             Project: Flink
>          Issue Type: Improvement
>          Components: DataSet API
>    Affects Versions: 1.0.0, 0.10.1
>            Reporter: Fabian Hueske
>            Assignee: Chiwan Park
>             Fix For: 1.0.0
>
>
> The following is not supported by the DataSet API:
> {code}
> DataSet<MyObject> data = ...
> DataSet<MyObject> data.sortPartition(
>   new KeySelector<MyObject, Long>() {
>     public Long getKey(MyObject v) {
>       ...
>     }
>   }, 
>   Order.ASCENDING);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to