[
https://issues.apache.org/jira/browse/FLINK-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15138591#comment-15138591
]
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_r52282275
--- Diff:
flink-scala/src/main/scala/org/apache/flink/api/scala/DataSet.scala ---
@@ -1508,6 +1508,31 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
new SortPartitionOperator[T](javaSet, field, order,
getCallLocationName()))
}
+ /**
+ * Locally sorts the partitions of the DataSet on the specified field
in the specified order.
+ * The DataSet can be sorted on multiple fields by chaining
sortPartition() calls.
+ *
+ * Note that any key extraction methods cannot be chained with the
KeySelector. To sort the
+ * partition by multiple values using KeySelector, the KeySelector must
return a tuple
+ * consisting of the values.
+ */
+ def sortPartition[K: TypeInformation](fun: T => K, order: Order):
DataSet[T] ={
--- End diff --
Copy the method docs from the `DataSet.java`.
> 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)