单项选择题在Spark中,假设lines是一个DStream对象,以下哪个语句可以周期统计这个流上的单词数?()
A.lines.flatMap(_.split”””)).map(word=>(word,1)).reduce(_+_).print()
B.lines.flatMap(_.split”””)).map(word=>(word,word.length())).reduceByKey(_+_).print()
C.lines.flatMap(_.split”””)).map(word=>(word,1)).reduceByKey(_+_).print()
D.lines.flatMap(_.split”””)).flatMap(word=>(word,1)).groupByKey(_+_).print()