https://www.cnblogs.com/skyl/p/4753703.html
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; //输入路径in01 in02 String in01 = "hdfs://RS5-112:9000/cs01/path01"; String in02 = "hdfs://RS5-112:9000/cs02/path02"; //多次调用addInputPath()方法 FileInputFormat.addInputPath(job,new Path(in0)); FileInputFormat.addInputPath(job,new Path(in1));
MultipleInputs.addInputPath(job,
new Path("hdfs://RS5-112:9000/cs01/path01"),
TextInputFormat.class,
Mapper01.class);
MultipleInputs.addInputPath(job,
new Path("hdfs://RS5-112:9000/cs02/path2"),
KeyValueInputFormat.class,
Mapper02.class);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31347383/viewspace-2731910/ ,如需转载,请注明出处,否则将追究法律责任。