Avro data files don't easily permit random access to records.  One
approach is that you could index the result of the previous
DataFileWriter#sync() of each record, then use DataFileReader#seek()
and scan for the desired record.

Also, please consider using SortedKeyValueFile.

http://avro.apache.org/docs/current/api/java/org/apache/avro/hadoop/file/SortedKeyValueFile.html

Doug

On Tue, Jun 4, 2013 at 9:32 AM, amit nanda <[email protected]> wrote:
> Hi,
>
> I have avro files that have a number of records in each file, we generate
> indexes using Lucene for these files, and now depending upon the index
> matches I want to read some specific records from the avro file.
>
> I am using DataFileReader for this, but i am not able to find a way to read
> random records. ANy help is much appreciated.
>
>
>
>

Reply via email to