Advertisement
deflorator1980

Untitled

Nov 10th, 2017
3,142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARK 0.30 KB | None | 0 0
  1. object Parsing {
  2.   def main(args: Array[String]) {
  3.         val sc = new SparkContext(new SparkConf().setAppName("Book").setMaster("local[4]"))
  4.         sc.textFile("README_SPARK.md").flatMap(l => l.split(" ")).map(w => (w, 1)).reduceByKey(_+_).map(p => p.swap).sortByKey(false).take(5).foreach(println)
  5.   }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement