NullWritable has a get() method that returns the singleton instance of the NullWritable. - Aaron
On Tue, Dec 16, 2008 at 9:30 AM, David Coe <david....@chalklabs.net> wrote: > Owen O'Malley wrote: > > > > On Dec 16, 2008, at 9:14 AM, David Coe wrote: > > > >> Does the SequenceFileOutputFormat work with NullWritable as the value? > > > > Yes. > > Owen O'Malley wrote: > > It means you are trying to write a null value. Your reduce is doing > > something like: > > > > output.collect(key, null); > > > > In TextOutputFormat, that is ok and just skips it. > > SequenceFileOutputFormat doesn't like nulls. > > > > -- Owen > Since the SequenceFileOutputFormat doesn't like nulls, how would I use > NullWritable? Obviously output.collect(key, null) isn't working. If I > change it to output.collect(key, new IntWritable()) I get the result I > want (plus an int that I don't), but output.collect(key, new > NullWritable()) does not work. > > Thanks again. > > David > >