首页 > 代码库 > Spark学习笔记

Spark学习笔记

Spark学习笔记

转贴请声明原文:http://blog.csdn.net/duck_genuine/article/details/40506715

join跟union方法測试效果

join(otherDataset, [numTasks]):(K, V) join (K, W) => (K, (V, W))

測试过假设  没有join到的key,就没有数据,也就是两个RDD没有共同的K,则没有对应的数据

如:

res15: Array[(Int, Int)] = Array((1,2), (2,3), (3,4))


res16: Array[(Int, Int)] = Array((1,2), (2,3), (4,5))


两个list 的join结果例如以下:


res17: Array[(Int, (Int, Int))] = Array((1,(2,2)), (2,(3,3)))



union(otherDataset)   返回一个新的数据集,由原数据集和參数联合而成

两个list 的 union结果例如以下:

res18: Array[(Int, Int)] = Array((1,2), (2,3), (3,4), (1,2), (2,3), (4,5))



临时未測试map的 



spark样例

https://github.com/apache/spark/tree/master/examples/src/main/scala/org/apache/spark/examples


XGraph  图计算
http://spark.apache.org/docs/latest/graphx-programming-guide.html#migrating-from-spark-091


spark streaming  流式计算




学习资料

http://shiyanjun.cn/archives/744.html



http://fossies.org/linux/spark/core/src/test/java/org/apache/spark/JavaAPISuite.java





Spark学习笔记