2018年8月14日

摘要: first count reduce collect take top takeOrdered aggregate fold lookup countByKey foreach foreachPartition sortBy 阅读全文

posted @ 2018-08-14 16:06 打杂滴 阅读(91) 评论(0) 推荐(0) 编辑

摘要: cache persist checkpoint 阅读全文

posted @ 2018-08-14 16:03 打杂滴 阅读(92) 评论(0) 推荐(0) 编辑

摘要: partitionBy mapValues flatMapValues combineByKey scala> aa.collect res77: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) scala> val mapRDD=aa.map(x 阅读全文

posted @ 2018-08-14 16:02 打杂滴 阅读(150) 评论(0) 推荐(0) 编辑

摘要: zip函数用于将两个RDD组合成Key/Value形式的RDD,这里默认两个RDD的partition数量以及元素数量都相同,否则会抛出异常。 scala> val aa=sc.makeRDD(1 to 10) aa: org.apache.spark.rdd.RDD[Int] = Parallel 阅读全文

posted @ 2018-08-14 15:45 打杂滴 阅读(400) 评论(0) 推荐(0) 编辑

摘要: Spark中提供了通用接口来抽象每个RDD,这些接口包括: 1.分区信息 2.依赖关系 3.函数,基于父RDD计算方法 4.划分策略和数据位置的元数据 阅读全文

posted @ 2018-08-14 15:12 打杂滴 阅读(90) 评论(0) 推荐(0) 编辑


Copyright © 2024 打杂滴
Powered by .NET 8.0 on Kubernetes