avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Echo Li <echo...@gmail.com>
Subject Re: How to deserialize avro file with union/many schemas?
Date Fri, 25 Jul 2014 00:13:12 GMT
thanks for reply.

I used both command line tool and the api code as below:
       GenericDatumReader datum = new GenericDatumReader();
       DataFileReader reader = new DataFileReader(inFile, datum);
       Schema schema = reader.getSchema();

I guss the problem is with the avro file, I know the file is not written
with avro library.

we are working on some other solutions. thanks!

On Thu, Jul 24, 2014 at 9:18 AM, Doug Cutting <cutting@apache.org> wrote:

> On Thu, Jul 24, 2014 at 7:23 AM, Echo <echolql@gmail.com> wrote:
> > The avro library can't read the file with that 'union' schema, so I
> wonder:
> With which Avro library can't you read a file with a union schema?
> Unions are a standard feature and every implementation should be able
> to read a file with such a schema.
> You can view the file contents with the 'tojson' command line tool:
> java -jar /path/to/avro-tools.jar tojson --pretty myfile.avro
> (You can also use the 'getschema' command line tool to view the schema
> of the file.)
> Doug

View raw message