Reputation: 1311
I am trying to write Multiple output files using MultipleOutputs. Howevere i want my FileOutputFormat to be of two different format i.e. Text and SequenceFileFormat for different files. Is there any way i can achieve this ?
Upvotes: 0
Views: 59
Reputation: 1810
Refer to the following Link: MultipleOutputs
Use the method : addNamedOutput
public static void addNamedOutput(Job job,
String namedOutput,
Class<? extends OutputFormat> outputFormatClass,
Class<?> keyClass,
Class<?> valueClass)
So essentially your code would look like :
MultipleOutputs.addNamedOutput(job, "Output1", SequenceFileOutputFormat.class, Text.class, Text.class);
MultipleOutputs.addNamedOutput(job, "Output1", TextOutputFormat.class, NullWritable.class, Text.class);
HTH.
Upvotes: 1