遇到了一个小问题,就是无法读取文件
控制台报错
具体错误定位:
Exception in thread "main" java.lang.RuntimeException: Error while running command to get file permissions : java.io.IOException: (null) entry in command string: null ls -F C:\Users\echo\IdeaProjects\spark-study\datas\test01.txt
解决方法,简单粗暴
直接改成绝对路径
val lines: RDD[String] = sc.textFile("C:\\Users\\echo\\IdeaProjects\\spark-study\\datas\\test02.txt")