下面来看看groupByKey和reduceByKey的区别: val conf = new SparkConf().setAppName("GroupAndReduce").setMaster("local") val sc = new SparkContext(conf) val words = Array("one", "two", "two", "three", "th…
RDD RDD(Resilient Distributed Dataset)叫做弹性分布式数据集,是Spark中最基本的数据抽象.代码中是一个抽象类,它代表一个弹性的.不可变.可分区.里面的元素可并行计算的集合. A Resilient Distributed Dataset (RDD), the basic abstraction in Spark. Represents an immutable:可类比String,它也是不可变的,但是可有很多方法,如切分... 1. RDD的属性 每…