avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Extracting records as bytes from avro file
Date Wed, 15 Oct 2014 17:15:57 GMT
There is no method to read individual records as binary since they're
not delimited nor length-prefixed.  Instead you can get a block of
records as binary and the count of records in the block and pass that
to a deserializer that parses individual records.

Doug

On Wed, Oct 15, 2014 at 4:47 AM, Ivan Balashov <ibalashov@gmail.com> wrote:
> Hi,
>
> Imagine a scenario where one reads avro file and distributes
> individual records (aka datums). Suppose the schema is known, and we
> just need to pass records as bytes to another system for further
> processing.
>
> Given the above, is there a way to read individual records as bytes
> without deserialising them first?
>
> As far as the documentation goes it can be easily done with blocks,
> but it doesn't mention records.
>
> Just to be more clear, there is a method which allows to write encoded
> datum to stream
> org.apache.avro.file.DataFileWriter#appendEncoded
>
> Is there a similar method for reading records as bytes?
>
> Thanks,

Mime
View raw message