标签:
Spark读入本地文件后,成为MapPartitionsRDD,可以使用zipWithIndex,转换成ZippedWithIndexRDD:
查看结果,每一行变为二元组“(内容,索引)”,索引从0开始:
(# Apache Spark,0)
("",1)
(Spark is a fast and general cluster computing system for Big Data. It provides,2)
……
标签:
原文地址:http://www.cnblogs.com/kevingu/p/4633397.html