You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/06 08:39:25 UTC

[jira] [Commented] (FLINK-3650) Add maxBy/minBy to Scala DataSet API

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

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

GitHub user ramkrish86 opened a pull request:

    https://github.com/apache/flink/pull/1856

    FLINK-3650 Add maxBy/minBy to Scala DataSet API

    I have tried to expose the maxBy/minBy API to scala DataSet. But one thing to note is that in the existing scala DataSet API code groupBy() API returns a GroupedDataSet whereas in the case of java DataSet API it is UnsortedGrouping. The code in scala DataSet is
    
    `  //  public UnsortedGrouping<T> groupBy(String... fields) {
      //    new UnsortedGrouping<T>(this, new Keys.ExpressionKeys<T>(fields, getType()));
      //  }
    `
    already commented out. The UnsortedGrouping internally has maxBy and minBy. So in this PR I have not tried to change those and hence the test case also does not cover groupBy() clause followed by maxBy and minBy ( they are now available only in java based MAxOperatorTest class).
    Please review and provide valuable feedback.
    Please note the change done to SelectByMaxFunction and SelectByMinFunction to support all Tuples but the API itself checks if the type is of type Tuple. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ramkrish86/flink FLINK-3650

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1856.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1856
    
----
commit 1b46ebfa3489432adde5a032c892dd5ec6c6d61c
Author: Vasudevan <ra...@intel.com>
Date:   2016-04-06T06:13:07Z

    FLINK-3650 Add maxBy/minBy to Scala DataSet API

----


> Add maxBy/minBy to Scala DataSet API
> ------------------------------------
>
>                 Key: FLINK-3650
>                 URL: https://issues.apache.org/jira/browse/FLINK-3650
>             Project: Flink
>          Issue Type: Improvement
>          Components: Java API, Scala API
>    Affects Versions: 1.1.0
>            Reporter: Till Rohrmann
>            Assignee: ramkrishna.s.vasudevan
>
> The stable Java DataSet API contains the API calls {{maxBy}} and {{minBy}}. These methods are not supported by the Scala DataSet API. These methods should be added in order to have a consistent API.



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