Why do JsonGenerator encodeBinary as unicode string?

2014-09-26 Thread Patrick Nip
Hi I am wondering why avro-cpp JsonGenerator encodeBinary encode every byte as unicode? 132 class AVRO_DECL JsonGenerator { 157 158 void escapeCtl(char c) { 159 out_.write('\\'); 160 out_.write('U'); 161 out_.write('0'); 162

Is this a bug?

2014-09-25 Thread Patrick Nip
According to the documentation: https://avro.apache.org/docs/current/api/cpp/html/classavro_1_1GenericDatum.html#a879e7b725023bfd8246e15f07cb5bef0 avro::GenericDatum::GenericDatum( const ValidSchemahttps://avro.apache.org/docs/current/api/cpp/html/classavro_1_1ValidSchema.html

Is it legal avro schema to have a name tie to different type in different record

2014-09-14 Thread Patrick Nip
Hi All, Is the following legal schema: { { metadata : { schema : { family : search, version : v1, attrs : [ srch ] } } }{ metadata : { schema : { family : UDB, version : v1, attrs : [ login, reg ] } } } } Note the

How to update an union field genericly

2014-09-14 Thread Patrick Nip
I am trying to use the c++ generic interface to update the following record: { type: record, namespace: com.abc.v1, name: “def, fields: [ { name: id, type: [ null, bytes ] } ] }

Re: How to update an union field genericly

2014-09-14 Thread Patrick Nip
Completed code sample: #include attributes.hh #include avro/Encoder.hh #include avro/Decoder.hh #include boost/algorithm/string.hpp #include boost/typeof/typeof.hpp #include iomanip #include vector #include fstream #include avro/Compiler.hh #include avro/Generic.hh #include

Can avro cpp support multiple records?

2014-09-05 Thread Patrick Nip
[https://mail.google.com/mail/u/1/images/cleardot.gif] More specifically if I have the following payload with 2 records, metadata and data. Can avro cpp library parse each record successively? If it can, can you shared some code sample of how that can be done? I know the Java library