1.输入
c1 85
c2 77
c3 88
c1 22
c1 66
c3 95
c3 54
c2 91
c2 66
c1 54
c1 65
c2 41
c4 65
2.代码实现
import org.apache.spark.{SparkContext, SparkConf}
/**
* User:leen
* Date:2017/10/18 0018
* Time:19:47
* 分组之后取出每组的TopN
*/
object GroupTopN1 {
def main(args: Array[String]) {
val conf = new SparkConf().setAppName("GroupTopN1").setMaster("local")
val sc = new SparkContext(conf)
v