Spark Core 算子常见面试题
1.手敲WCreduceByKeysc.textFile("data/wccount.txt") .flatMap(_.split(" ")) .map(x=>{ (x,1) }) .reduceByKey(_+_) .foreach(println)sc.stop()groupBykeysc.textFile("data/wccount.txt") .flatMap(_.split(" ")) .map(x=>{ (x,1
原创
2022-04-17 00:21:27 ·
1773 阅读 ·
0 评论