spark关于wordcount的数据流
2017-10-27 14:37:56 0 举报
spark关于wordcount的数据流
作者其他创作
大纲/内容
hello hadoop
mappartitionsRDD
stage1
var words=lines.flatmap(line=line.split(\" \"))
partition上reduce操作
mr.saveAsTextFile(\"/test\")
数据整理并入hdfs
map
hello spark hello hgq
从hdfs中读取分布式文件,并且以数据分片的方式存于集群中
shuffer
hello spark hello hgqhello hadoophello scala
对每个partition的每行进行单词切分
stage0
hello scala
textFile
var mr=wp.reduceBykey(_+_)
flatmap
hadoopRDD
shuffer之前本地reduce操作
基于hadoopRDD产生的partition去掉行key
var lines = sc.textFile(\"/test.txt\
shufferedRDD
hdfs中分布式文件test.txt

收藏
0 条评论
下一页