hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Kimball" <aa...@cloudera.com>
Subject Re: Output.collect uses toString for custom key class. Is it possible to change this?
Date Thu, 18 Dec 2008 02:44:47 GMT
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.coe@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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message