我想在Map-Reduce程序中读取多个目录中的多个文件.我试图在main方法中给出文件名:
FileInputFormat.setInputPaths(conf,new Path("hdfs://localhost:54310/user/test/"));
FileInputFormat.setInputPaths(conf,new Path("hdfs://localhost:54310/Test/test1/"));
Run Code Online (Sandbox Code Playgroud)
但它只是从一个文件中读取.
我该怎么做才能读取多个文件?
请提出解决方案.
谢谢.
FileInputFormat#setInputPaths将覆盖先前设置的输入路径后设置输入路径.使用FileInputFormat#addInputPath或FileInputFormat#addInputPaths添加到现有路径.
| 归档时间: |
|
| 查看次数: |
4031 次 |
| 最近记录: |