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

Switch to Plain View
Avro >> mail # user >> Embedding schema with binary encoding

Copy link to this message
Embedding schema with binary encoding
I am able to serialize with binary encoding to a file using following :
        FileOutputStream outputStream = new FileOutputStream(file);
        Encoder e = EncoderFactory.get().binaryEncoder(outputStream, null);
        DatumWriter<GenericRecord> datumWriter = new
        GenericRecord message1= new GenericData.Record(schema);
        message1.put("to", "Alyssa");
        datumWriter.write(message1, e);

But the output file contains only serialized data and not schema. How can I
add schema also ?

Pratyush Chandra
Scott Carey 2013-01-08, 09:26
Pratyush Chandra 2013-01-08, 09:49
Scott Carey 2013-01-09, 19:22
Pratyush Chandra 2013-01-09, 19:47