avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wei Yang <...@weizilla.com>
Subject DataFileWriter/Reader vs Encoder/Decoders in Java
Date Wed, 13 Jul 2011 19:15:23 GMT
I'm just learning Avro but am quite confused about the different ways of
writing and reading data in Java.

Along with the required GenericDatumWriter/Reader (or Specific), it seems
like there are two ways of writing/reading data: one using the
DataFileWriter/Reader and Encoder/Decoders.

>From the code that I've played around with and seen, the DataFileWriter
method only writes in binary and will encode the schema into the output.
With the Encoder/Decoder method, the output can be Json or binary but will
not contain the schema. Therefore, when using that method, the writer schema
file is required on the reader side.

So my questions are: 1.) Is there a way to encode the schema into the output
using the Encoder/Decoder method? 2.) Is there a way to encode the schema
into an Json output? 3.) How does the DataFileWrite/Reader,
GenericDatumWriter/Reader and Encoder/Decoder all fit together
architecturally?

Mime
View raw message