Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro, mail # user - read a compressed avro file

Copy link to this message
Re: read a compressed avro file
Scott Carey 2012-04-02, 15:56
Reading an Avro file is the same for all compression types. The header of
the file contains what compression codec is used and the schema for the data
within it.

A basic read may look like:

DataFileReader<Object> reader = new DataFileReader<Object>(myFile, new
try {
  for(Object datum : reader) {
    // do something with the datum
} finally {
The documentation is here:

Several examples can be found in the unit tests named TestDataFile*.java:
On 3/30/12 11:10 PM, "Weishung Chung" <[EMAIL PROTECTED]> wrote:

> java
> On Sat, Mar 31, 2012 at 12:44 AM, Miki Tebeka <[EMAIL PROTECTED]> wrote:
>>> > Could you guide me to an example on how to read a compressed avro file
>>> > (snappy) ?
>> In which programming language?