Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist

时间:2024-03-24 10:31:11

@Exception in thread “main” org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/data1/h.txtOC

Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist
Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist程序内容
//val linesRDD: RDD[String] = sparkContext.textFile(“C:\Users\dongj\IdeaProjects\spark232_1805\data1\h”)
//val linesRDD: RDD[String] = sparkContext.textFile(“D:\h.txt”)
// val linesRDD: RDD[String] = sparkContext.textFile(“D:\h.txt.txt”)
val linesRDD: RDD[String] = sparkContext.textFile(“file:///data1\h.txt”) 此句会出错

上面加粗内容,会出错
而其他三行都可以执行
异常原因是:
1.win10电脑的扩展名被隐藏了,而之前如果不加就不行
将文件名√上。
Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist
Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist
2.复制全文件名
val linesRDD: RDD[String] = sparkContext.textFile(“C:\Users\dongj\IdeaProjects\spark232_1805\data1\h”)
Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist