Spark:读取hdfs的文本文件

spark读取hdfs上面的文件:

var textIn = sc.textFile("hdfs://localhost:9000/user/root/text.in")

保存文件到hdsf上:

textIn.map((_, 2)).saveAsTextFile("hdfs://localhost:9000/user/root/outdir")
posted @ 2019-01-03 15:27  xuejianbest  阅读(1632)  评论(0编辑  收藏  举报