您当前的位置: 首页 >  大数据

段智华

暂无认证

  • 0浏览

    0关注

    1232博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

大数据IMF传奇 第19课 spark 二次排序 使用JAVA自定义key 进行二次排序

段智华 发布时间:2016-01-24 20:56:30 ,浏览量:0

scala> sc.textFile("/README.txt").flatMap(_.split(" ")).map((_,1)).reduceByKey(_+_).map(x =>(x._2,x._1)).sortByKey(false).map(x=>(x._2,x._1)).collect

res0: Array[(String, Int)] = Array(("",18), (the,8), (and,6), (of,5), (The,4), (this,3), (encryption,3), (for,3), (cryptographic,3), (Software,2), (which,2), (at:,2), (software,2), (re-export,2), (includes,2), (import,,2), (software.,2), (possession,,2), (our,2), (please,2), (distribution,2), (on,2), (using,2), (or,2), (use,,2), (information,2), (to,2), (software,,2), (more,2), (Export,2), (Hadoop,1), (Commodity,1), (For,1), (country,1), (under,1), (it,1), (Jetty,1), (Technology,1), (http://www.wassenaar.org/>,1), (have,1), (http://wiki.apache.org/hadoop/,1), (BIS,1), (classified,1), (This,1), (foll

关注
打赏
1659361485
查看更多评论
立即登录/注册

微信扫码登录

0.0433s