码迷,mamicode.com
首页 > 其他好文 > 详细

Spark学习笔记

时间:2014-10-27 14:24:19      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   os   ar   java   sp   数据   

Spark学习笔记


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学习笔记

标签:style   blog   http   io   os   ar   java   sp   数据   

原文地址:http://blog.csdn.net/duck_genuine/article/details/40506715

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!