1
我的机器是windows机器。我正在eclipse IDE中测试我的spark代码。在Spark中读取windows网络文件
我有我的文件sample.txt
存储在网络文件夹。
文件的位置属性是\\\aloha\logfolder
。
我想在sparkcontext中读取它。以下是我的代码片段。
val conf = new SparkConf().setAppName("WordCount").setMaster("local")
val sc = new SparkContext(conf)
val inp = sc.textFile("\\\\aloha\\logfolder\\sample.txt")
但我得到了以下错误:
Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file://aloha/logfolder/sample.txt
我曾尝试以下选项,以及。
val inp = sc.textFile("file:\\\\aloha\\logfolder\\sample.txt")
val inp = sc.textFile('file:\\\\aloha\\logfolder\\sample.txt')
但似乎没有工作。
当我将同一个文件复制到我的C盘,它的工作。
val inp = sc.textFile("C:\\Desktop\\logfolder\\sample.txt')
有什么想法我错过了什么?
谢谢拉姆。你知道任何其他解决方法来读取火花中的这些文件吗? – user7264473
使用'robocopy'手动或本地复制它们到hdfs,这是我所知道的唯一的东西。 –