创建RDD的三种方式
1、val rdd = sc.textFile...
val lines :RDD[String] = sc.textFile("./data/words")
2、val rdd = sc.parallelize(Seq[xx](... ...))
val result :RDD[String]= sc.parallelize(Array[String]("a","b","c"))
3、val rdd = sc.makeRDD(Seq[xx](... ...))
val result: RDD[(String, Int)] = sc.makeRDD(Array[(String, Int)](
("a", 10),
("b", 20),
("c", 30)
))
或
val result: RDD[Int] = sc.makeRDD(Array[Int](1,2,3,4,5,6))