You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Jun Rao <ju...@gmail.com> on 2014/11/23 19:40:17 UTC

any optimization in reading a partial schema in the decoder?

Hi,

Suppose that the writer schema has a header record, if I set the reader
schema to be just the header part in a GenericDatumReader, does it
construct the header record efficiently w/o deserializing the whole record
first?

Thanks,

Jun

Re: any optimization in reading a partial schema in the decoder?

Posted by Arvind Kalyan <ba...@gmail.com>.
Yes. The writer+reader schema paired usage lets you do efficient partial
deserialization. Even if the fields are non-consecutive, in which case it
jumps over fields that it doesn't have to deserialize. In your case the
deserialization would stop right after the header is deserialized.

On Sun, Nov 23, 2014 at 10:40 AM, Jun Rao <ju...@gmail.com> wrote:

> Hi,
>
> Suppose that the writer schema has a header record, if I set the reader
> schema to be just the header part in a GenericDatumReader, does it
> construct the header record efficiently w/o deserializing the whole record
> first?
>
> Thanks,
>
> Jun
>



-- 
Arvind Kalyan
http://www.linkedin.com/in/base16
cell: (408) 761-2030