[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
spark:spark-introduction [2014/11/11 09:13]
straka
spark:spark-introduction [2015/07/27 17:51]
straka
Line 51: Line 51:
 val counts = words.map(word => (word,1)).reduceByKey((c1,c2) => c1+c2) val counts = words.map(word => (word,1)).reduceByKey((c1,c2) => c1+c2)
 val sorted = counts.sortBy({case (word, count) => count}, ascending=false) val sorted = counts.sortBy({case (word, count) => count}, ascending=false)
-sorted.saveAsTextFile('output')+sorted.saveAsTextFile("output")
  
 // Alternatively without variables and using placeholders in lambda parameters: // Alternatively without variables and using placeholders in lambda parameters:

[ Back to the navigation ] [ Back to the content ]