MapReduce主程序FileInputFormat.setInputPaths读取文件报错

it2026-01-15  7

报错如下:Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 解决方法: 把args[0]改成路径格式

"hdfs://node1:8020/自己要读取的文件的文件夹名/文件名"

node1为自己的主机名 配置详情在${HADOOP_HOME}/etc/hadoop中的core-site.xml

结果如下:

另外如果多表查询时,可以指定文件夹名,然后再Mapper阶段做判断(处理的是哪个数据)

最新回复(0)