I am using AvroKeyInputFormat. I have not specified a reader schema. From my mapper, I would like to access the schema that was used to write the container file (i.e. the writer schema).
Is there a way to do this?
If not, is this a reasonable enhancement request?
It does look like I could use FileSplit#getPath() to access the container file manually and pull out the schema. This may work but it seems a shame to do this work when it looks like the schema has already been pulled out by AvroRecordReaderBase#createAvroFileReader(...)
Also, I suppose you can always derive the effective schema from the datum when reading records, primitives, etc. However, it seems difficult to derive a schema when dealing with a list or map container file. And, it seems impossible when dealing with a union type container.
On Wed, Feb 27, 2013 at 10:02 AM, Doug Cutting <[EMAIL PROTECTED]> wrote:
> On Wed, Feb 27, 2013 at 8:55 AM, Josh Spiegel <[EMAIL PROTECTED]> wrote: > > If not, is this a reasonable enhancement request? > > Yes. I don't think this is currently possible, and adding it seems > like it would be useful. > > Doug >
All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by Sematext