Thank you. I confirmed the page. 2015-06-04 1:35 GMT+09:00 Sean Owen <so...@cloudera.com>: > Yes, I think you're right. Since this is a change to the ASF hosted > site, I can make this change to the .md / .html directly rather than > go through the usual PR. > > On Wed, Jun 3, 2015 at 6:23 PM, linkstar350 . <tweicomepan...@gmail.com> > wrote: >> Hi, I'm Taira. >> >> I notice that this example page may be a mistake. >> >> https://spark.apache.org/examples.html >> >> ============================ >> Word Count (Java) >> >> JavaRDD<String> textFile = spark.textFile("hdfs://..."); >> JavaRDD<String> words = textFile.flatMap(new FlatMapFunction<String, >> String>() { >> public Iterable<String> call(String s) { return Arrays.asList(s.split(" >> ")); } >> }); >> JavaPairRDD<String, Integer> pairs = words.mapToPair(new >> PairFunction<String, String, Integer>() { >> public Tuple2<String, Integer> call(String s) { return new >> Tuple2<String, Integer>(s, 1); } >> }); >> JavaPairRDD<String, Integer> counts = pairs.reduceByKey(new >> Function2<Integer, Integer>() { >> public Integer call(Integer a, Integer b) { return a + b; } >> }); >> counts.saveAsTextFile("hdfs://..."); >> ============================ >> >> Function2 should have three generic type arguments, but there are only two. >> >> I hope for your consideration. >> >> Taira >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@spark.apache.org >> For additional commands, e-mail: user-h...@spark.apache.org >>
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org