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