spark去重计数操作(代码示例)

val cityUserNoAppTypeDStream = CitySummaryBolt.noAppType(cleanBoltData)
.map(x => (x, 0)).reduceByKey(_ + _).map(x => x._1).map(x => (x._1, 1l)).reduceByKey(_ + _)
posted @ 2020-03-06 10:03  纯捡垃圾吃的  阅读(861)  评论(0编辑  收藏  举报
返回顶部