Spark的transformation算子
1)单Value
- map
- mapPartitions
- mapPartitionsWithIndex
- flatMap
- glom
- groupBy
- filter
- sample
- distinct
- coalesce
- repartition
- sortBy
- pipe
2)双vlaue - intersection
- union
- subtract
- zip
3)Key-Value - partitionBy
- reduceByKey
- groupByKey
- aggregateByKey
- foldByKey
- combineByKey
- sortByKey
- mapValues
- join
- cogroup
Spark的action算子
- reduce:
- collect:
- count
- first:
- take:
- takeOrdered
- aggregate:
- fold
- countByKey:
- save
- foreach: