avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: reader in hadoop without reader's schema
Date Mon, 05 Dec 2011 23:50:55 GMT
On 12/01/2011 07:32 PM, Koert Kuipers wrote:
> I am reading from avro container files in hadoop. I know the container
> files have a (writers) schema stored in them. My reader specifies it's
> schema using avro.input.schema job parameter. This way any schema
> changes are gracefully handled with both schema's present.
> 
> However, i dont always need all this complexity. Is there a way to read
> without having to specify a reader's schema, where i basically say "just
> accept the writer's schema and read the data that way".

That's what's done by default if you, e.g., do something like:

Iterable i = DataFileReader.openReader(file, new GenericDatumReader());
for (Object o : i) {
  System.out.println(o);
}

Doug

Mime
View raw message