Spark
Gerald Kwok
低到尘埃里,才能开出花来。
展开
-
Spark 算子 combineByKey
combineByKey 算子是一个稍微复杂的算子,所以在这里记录一下 combineByKey 的操作方式。 combineByKey 的参数 combineByKey 总共有三个参数 第一个参数是对相同分区,相同 key 的第一个 value 进行初始化。 第二个参数是对相同分区,相同 key 的 values 进行的操作。 第三个参数是对不同分区,相同 key 的 values 进行的操作。 举个栗子???? val conf = new SparkConf().setMaster("local"原创 2020-08-04 16:19:07 · 223 阅读 · 0 评论 -
Spark Aggregate算子
源码定义 /** * Aggregate the elements of each partition, and then the results for all the partitions, using * given combine functions and a neutral "zero value". This function can return a different result * type, U, than the type of this RDD, T. Thus原创 2020-07-26 11:33:05 · 280 阅读 · 0 评论 -
Spark核心RDD
Spark核心RDD RDD 全称为 Resilient Distributed Dataset 弹性分布式数据集 因为在刚接触了spark后,好像有很多这种 RDD 的类型,RDD 就是 spark 在计算过程中使用的数据集。 当 spark 从 HDFS 中读取了数据后,默认会依据 HDFS 的 block 数量去生成一个同等数量 RDD,RDD 里使用 partition 来相对应 HD...原创 2020-05-08 15:31:14 · 128 阅读 · 0 评论