Skip to content

Commit

Permalink
Fix local wc style
Browse files Browse the repository at this point in the history
  • Loading branch information
rnowling committed Nov 20, 2014
1 parent 94a4691 commit 44415b9
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ object DFSReadWriteTest {
}

def runLocalWordCount(fileContents: List[String]): Int = {
fileContents.flatMap {
ln => ln.split(" ") }.flatMap {
ln => ln.split("\t") }.filter {
ln => ln.size > 0 }.groupBy {
w => w }.mapValues {
lst => lst.size }.values.sum
fileContents.flatMap(_.split(" "))
.flatMap(_.split("\t"))
.filter(_.size > 0)
.groupBy(w => w)
.mapValues(_.size)
.values
.sum
}

def main(args: Array[String]) {
Expand Down

0 comments on commit 44415b9

Please sign in to comment.