错误提示:

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 +文件路径

在运行Hadoopapi时遇到以上问题,看了很多解决方法都不能很好的解决。看了下报错提示大概是文件路径取读不到。可以尝试以下两种方案:

1、input文件中的文件只有一个,可以将文件的全路径写上

 

FileInputFormat.addInputPath(job, new Path("D:\\Dedup\\input\\file1.txt"));
FileOutputFormat.setOutputPath(job, new Path("D:\\Dedup\\output"));

2、input文件中的文件有很多,需要全部取读

FileInputFormat.addInputPath(job, new Path("D:\\Dedup\\input/*"));
FileOutputFormat.setOutputPath(job, new Path("D:\\Dedup\\output"));
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐