Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Parsing {
- def main(args: Array[String]) {
- val sc = new SparkContext(new SparkConf().setAppName("Book").setMaster("local[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)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement