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

Mariem Ayadi commented on FLINK-991:
------------------------------------

In the [Java API 
documentation|http://flink.incubator.apache.org/docs/0.6-SNAPSHOT/java_api_guide.html]
 (Reduce on grouped DataSet section), we still mention that in order to group a 
POJO DataSet, one uses a KeySelector function.

{code:borderStyle=solid}
DataSet<WC> wordCounts = words
                         // DataSet grouping with inline-defined KeySelector 
function
                         .groupBy(
                           new KeySelector<WC, String>() {
                             public String getKey(WC wc) { return wc.word; }
                           })
{code}


My understanding is that with [Aljoscha's 
fix|https://github.com/apache/incubator-flink/commit/3f87fc9f1cc2f0e18552e6ec5e9449228a942726],
 we no longer need to do so
{code:borderStyle=solid}
DataSet<WC> counts = tokenized
 +                              .groupBy("word")
 +                              .reduce(new ReduceFunction<WC>() {
 +                                      public WC reduce(WC value1, WC value2) {
 +                                              return new WC(value1.word, 
value1.count + value2.count);
 +                                      }
 +                              });
{code}


Please clarify. It'll help me modify the proper parts of the documentation 
accordingly.

> Add documentation for POJO expression keys
> ------------------------------------------
>
>                 Key: FLINK-991
>                 URL: https://issues.apache.org/jira/browse/FLINK-991
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation, Java API
>    Affects Versions: 0.6-incubating
>            Reporter: Fabian Hueske
>            Assignee: Mariem Ayadi
>              Labels: starter
>
> The Java API documentation needs to be extended to reflect the extensions 
> added by FLINK-908.
> These are basically expression keys for POJO objects, i.e., selecting public 
> fields of POJOs as keys by their names.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to