前言
相信使用过mysql的同学对sql语句中distinct关键字并不陌生,使用distinct关键字可以对查询的数据进行去重操作,在Spark 中,可以做类似的理解;
函数签名
def distinct()(implicit ord: Ordering[T] = null): RDD[T]def distinct( numPartitions: Int )(implicit ord: Ordering[T] = null): RDD[T]
函数说明
将数据集中重复的数据去重
案例:对集合中的一组数字去重
import org.apache.spark.{S