Github user pwendell commented on a diff in the pull request: https://github.com/apache/spark/pull/17#discussion_r10192134 --- Diff: docs/java-programming-guide.md --- @@ -127,11 +132,20 @@ class Split extends FlatMapFunction<String, String> { JavaRDD<String> words = lines.flatMap(new Split()); {% endhighlight %} +Java 8+ users can also possibly write the above `FlatMapFunction` in a more concise way using +lambda expression as follows: + +{% highlight java %} +JavaRDD<String> words = lines.flatMap(s -> Arrays.asList(s.split(" "))); +{% endhighlight %} + +Same possibility applies to all passed in anonymous classes in java 8. --- End diff -- Nit, but maybe say: "This lambda syntax can be applied to all anonymous classes in Java 8".
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---