Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/87#discussion_r15665104
  
    --- Diff: docs/java_api_transformations.md ---
    @@ -431,6 +435,30 @@ DataSet<Tuple2<String, Double>>
                        .with(new PointWeighter());
     ```
     
    +#### Join with FlatJoinFunction
    +
    +Analogous to Map and FlatMap, a FlatJoin function behaves in the same
    +way as a JoinFunction, but instead of returning one element, it can
    +return (collect), zero, one, or more elements
    +
    +{% highlight java %}
    +public class PointWeighter
    +         implements FlatJoinFunction<Rating, Tuple2<String, Double>, 
Tuple2<String, Double>> {
    +
    +  @Override
    +  public void join(Rating rating, Tuple2<String, Double> weight,
    +
    +     Collector<Tuple2<String, Double>> out) {
    +   if (weight.f1 > 0.1)
    +           out.collect(new Tuple2<String, Double>(rating.name, 
rating.points * weight.f1));
    --- End diff --
    
    we enforce inside the main code to always use brackets around statements. 
(I think its the famous `goto fail;`).
    I think its better to have them in the documentation as well (to educate 
users that might become committers)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to