Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcaa1c82

Browse files
authored
Update WordCount.scala
1 parent128dced commitcaa1c82

File tree

1 file changed

+1
-1
lines changed
  • src/main/scala/com/sparkTutorial/pairRdd/aggregation/reducebykey

1 file changed

+1
-1
lines changed

‎src/main/scala/com/sparkTutorial/pairRdd/aggregation/reducebykey/WordCount.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object WordCount {
1414
valwordRdd= lines.flatMap(line=> line.split(""))
1515
valwordPairRdd= wordRdd.map(word=> (word,1))
1616

17-
valwordCounts= wordPairRdd.reduceByKey(_+ _)
17+
valwordCounts= wordPairRdd.reduceByKey((x, y)=> x+ y)
1818
for ((word, count)<- wordCounts.collect()) println(word+" :"+ count)
1919
}
2020
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp