Hdfs上的数据文件为T0,T1,T2(无后缀): T0: What has come into being in him was life, and the life was the light of all people. The light shines in the darkness, and the darkness did not overcome it. Enter through the narrow gate; for the gate is wide and the road…
def main(args: Array[String]): Unit = { val conf = new SparkConf() conf.set("spark.master", "local") conf.set("spark.app.name", "spark demo") val sc = new SparkContext(conf); // 读取hdfs数据 val textFileRdd = sc.textFil…