Owen O'Malley wrote:
>
> On Dec 16, 2008, at 8:28 AM, David Coe wrote:
>
>> Is there a way to output the write() instead?
>
>
> Use SequenceFileOutputFormat. It writes binary files using the write.
> The reverse is SequenceFileInputFormat, which reads the sequence files
> using readFields.
>
> -- Owen
Thank you for your swift response. I am getting this error when I try
your suggestion:
java.lang.NullPointerException
at
org.apache.hadoop.io.SequenceFile$Writer.append(SequenceFile.java:987)
at
org.apache.hadoop.mapred.SequenceFileOutputFormat$1.write(SequenceFileOutputFormat.java:70)
at
org.apache.hadoop.mapred.MapTask$DirectMapOutputCollector.collect(MapTask.java:385)
*My configuration:*
conf.setMapperClass(MyMap.class);
conf.setReducerClass(IdentityReducer.class);
conf.setOutputFormat(SequenceFileOutputFormat.class);
conf.setOutputKeyClass(MyClass.class);
*My mapper:*
public static class MyMap extends MapReduceBase implements
Mapper<LongWritable, Text, MyClass,NullWritable> {
public void map(LongWritable key, Text value,
OutputCollector<MyClass,NullWritable> output,
Reporter reporter) throws IOException {
*
My Class:*
public class MyClass implements Writable,
Comparable<MyClass> {
Which setting am I missing that results in the null pointer?
Thank you!!