我的运行环境是eclipse:
mapreduce在windows上运行时,指定输入路径的时候,如果路径下有很多文件,往往无法一次性识别。会遇到:java.lang.RuntimeException: Error while running command to get file permissions : java.io.IOException: (null) entry in command string: null ls -F *…这样的错误。
想要一次加载文件夹下的所有文件,解决办法如下:
//原来的代码如下:
//指定输入路径
Path inputPath = new Path("D:\\data\\input");
FileInputFormat.addInputPath(job, inputPath);
//修改后的代码如下:
//指定输入路径
Path inputPath = new Path("D:\\data\\{input/*}");
FileInputFormat.addInputPath(job, inputPath);
运行,就搞定了!好用请点赞!