ITPub博客

首页 > 大数据 > Hadoop > MR多输入

MR多输入

原创 Hadoop 作者:lcz393537415 时间:2020-11-03 16:17:15 0 删除 编辑

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/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: MR 博客记录
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2016-05-23

  • 博文量
    65
  • 访问量
    84703