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

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_r51870482
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/operators/SortPartitionOperator.java
 ---
    @@ -89,6 +100,22 @@ public SortPartitionOperator(DataSet<T> dataSet, String 
sortField, Order sortOrd
                return this;
        }
     
    +   /**
    +    * Appends an additional sort order with the specified field in the 
specified order to the
    +    * local partition sorting of the DataSet.
    +    *
    +    * @param keyExtractor The KeySelector function which extracts the key 
value of the additional
    +    *                     sort order of the local partition sorting.
    +    * @param order The order of the additional sort order of the local 
partition sorting.
    +    * @return The DataSet with sorted local partitions.
    +    */
    +   public <K> SortPartitionOperator<T> sortPartition(KeySelector<T, K> 
keyExtractor, Order order) {
    --- End diff --
    
    I would not allow chaining.
    In addition, we must make sure that `ExpressionKeys` and 
`SelectorFunctionKeys` are not mixed. So you can either use a single key 
selector or one or more expression keys.


> 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