[
https://issues.apache.org/jira/browse/SPARK-19696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sean Owen reassigned SPARK-19696:
---------------------------------
Assignee: Sean Owen
Priority: Minor (was: Major)
My fault, I actually introduced this when fixing/updating this and other
examples a couple days ago.
https://github.com/apache/spark-website/commit/879303593efa229d416eb4178913c1c1a6f7033c
> Wrong Documentation for Java Word Count Example
> -----------------------------------------------
>
> Key: SPARK-19696
> URL: https://issues.apache.org/jira/browse/SPARK-19696
> Project: Spark
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 2.1.0
> Reporter: gaurav gupta
> Assignee: Sean Owen
> Priority: Minor
>
> Java Word Count example of http://spark.apache.org/examples.html page is
> defined incorrectly
> '''
> JavaRDD<String> textFile = sc.textFile("hdfs://...");
> JavaRDD<String> words = textFile.flatMap(s -> Arrays.asList(s.split("
> ")).iterator())
> .mapToPair(word -> new Tuple2<>(word, 1))
> .reduceByKey((a, b) -> a + b);
> counts.saveAsTextFile("hdfs://...");
> ''
> It should be
> '''
> JavaRDD<String> textFile = sc.textFile("hdfs://...");
> JavaPairRDD<String, Integer> counts = textFile.flatMap(s ->
> Arrays.asList(s.split(" ")).iterator())
> .mapToPair(word -> new Tuple2<>(word, 1))
> .reduceByKey((a, b) -> a + b);
> counts.saveAsTextFile("hdfs://...");
> ''''
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]