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

Rafael Guglielmetti commented on SPARK-19156:
---------------------------------------------

[~srowen] Thanks!

Unfortunately I'm a beginner and I'm not sure how to solve the problem.

I tried:
{code:xml}
JavaRDD<String> words = textFile.flatMap(new FlatMapFunction<String, String>() {
  public Iterator<String> call(String s) { return Arrays.asList(s.split(" 
")).iterator(); }
});
{code}

But then I got an exception:
Exception in thread "main" org.apache.spark.SparkException: Task not 
serializable

> Example in the doc not working
> ------------------------------
>
>                 Key: SPARK-19156
>                 URL: https://issues.apache.org/jira/browse/SPARK-19156
>             Project: Spark
>          Issue Type: Documentation
>          Components: Java API
>    Affects Versions: 2.1.0
>            Reporter: Rafael Guglielmetti
>            Priority: Minor
>              Labels: documentation, examples, java
>
> The first Java example in the following page does not seem to work anymore:
> http://spark.apache.org/examples.html
> FlatMapFunction should return an Iterator and not an Iterable in recent 
> versions of Spark.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to