You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "John Mu (JIRA)" <ji...@apache.org> on 2017/02/09 02:33:41 UTC

[jira] [Commented] (FLINK-2184) Cannot get last element with maxBy/minBy

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

John Mu commented on FLINK-2184:
--------------------------------

Is anyone working on this? The PR looks like it got messed up.
I can have a go.

However, if the goal is for the Java and Scala APIs to be the same there is an issue. 
The default value on {{first}} for {{ComparableAggregator}} is false. This true for the {{min}} and {{max}} aggregators in the Java API. However, for the Scala API {{org.apache.flink.streaming.api.scala.WindowedStream#aggregate}} sets {{first}} to true by default. Which one should it be?
I'm guessing the Scala method needs more cases for the {{max}} and {{min}} case. 



> Cannot get last element with maxBy/minBy
> ----------------------------------------
>
>                 Key: FLINK-2184
>                 URL: https://issues.apache.org/jira/browse/FLINK-2184
>             Project: Flink
>          Issue Type: Improvement
>          Components: Scala API, Streaming
>            Reporter: Gábor Hermann
>            Priority: Minor
>
> In the streaming Scala API there is no method
> {{maxBy(int positionToMaxBy, boolean first)}}
> nor
> {{minBy(int positionToMinBy, boolean first)}}
> like in the Java API, where _first_ set to {{true}} indicates that the latest found element will return.
> These methods should be added to the Scala API too, in order to be consistent.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)