我有一个用于编写多个输出的代码org.apache.hadoop.mapreduce.lib.output.MultipleOutputs
。
Reducer 将结果写入预先创建的位置,因此我不需要默认的 o/p 目录(其中包含_history
和_SUCCESS
目录)。
在再次运行我的工作之前,我必须每次都删除它们。
所以我删除了这TextOutputFormat.setOutputPath(job1,new Path(outputPath));
条线。但是,这给了我(预期的)错误org.apache.hadoop.mapred.InvalidJobConfException: Output directory not set
司机等级:
MultipleOutputs.addNamedOutput(job1, "path1", TextOutputFormat.class, Text.class,LongWritable.class);
MultipleOutputs.addNamedOutput(job1, "path2", TextOutputFormat.class, Text.class,LongWritable.class);
LazyOutputFormat.setOutputFormatClass(job1,TextOutputFormat.class);
减速机类:
if(condition1)
mos.write("path1", key, new LongWritable(value), path_list[0]);
else
mos.write("path2", key, new LongWritable(value), path_list[1]);
是否有避免指定默认输出目录的解决方法?