spark算子

 

transformation算子

1、map()

2、flatmap()

3、mapPartitions()

4、union()

5、groupByKey()

6、filter()

7、distinc()去重

8、subtract()集合的差操作

9、cache()从磁盘缓存到内存

10、persist()缓存操作

11、combineByKey()类似于MR中的combiner

12、reduceByKey()

13、partitionBy()分区操作

action算子

1、foreach(x=>println())

2、saveAsTextFile()

3、collect()

4、count()

5、top()

6、reduce()

posted @ 2018-01-17 23:06  乡村骑士2  阅读(115)  评论(0编辑  收藏  举报