Re: How to extract String from GenericRecorcd as null instead of null string?

2016-12-16 Thread Check Peck
to do with your use of 'valueOf'. You need > to check for null before you call it. More info's here. > > http://stackoverflow.com/questions/13577892/what-is- > difference-between-null-and-null-of-string-valueofstring-object > > J > > On Fri, Dec 16, 2016 at 5:54 PM, Check Peck <compt

How to extract String from GenericRecorcd as null instead of null string?

2016-12-16 Thread Check Peck
I am working with Avro and in my avro schema I have one field like this: { "name" : "userId", "type" : [ "null", "string" ], "doc" : "some doc" }, This is how I am extracting userId field from GenericRecord: GenericRecord payload =

Re: How to get typed value from GenericRecord?

2016-11-24 Thread Check Peck
Can anyone help me with this? On Thu, Nov 24, 2016 at 10:29 AM, Check Peck <comptechge...@gmail.com> wrote: > I am working with Avro and I have a GenericRecord. I want to extract > clientId and deviceName from it. In the Avro Schema, clientId is integer > and deviceName is Stri

How to get typed value from GenericRecord?

2016-11-24 Thread Check Peck
I am working with Avro and I have a GenericRecord. I want to extract clientId and deviceName from it. In the Avro Schema, clientId is integer and deviceName is String. My question is - what is the recommended way to retrieve a typed value, as opposed to an Object or extracting everything as a

Re: Not able to load avro schema fully with all its contents

2015-05-19 Thread Check Peck
Can anyone help me with this? On Mon, May 18, 2015 at 2:04 PM, Check Peck comptechge...@gmail.com wrote: Does anyone have any idea on this why it is behaving like this? On Mon, May 18, 2015 at 1:03 PM, Check Peck comptechge...@gmail.com wrote: And this is my to_string method I forgot

Not able to load avro schema fully with all its contents

2015-05-18 Thread Check Peck
I am working with Apache Avro in C++ and I am trying to load avro schema by using Avro C++ library. Everything works fine without any issues, only problem is - I have few doc in my Avro schema which is not getting shown at all in my AvroSchema when I try to load it and also print it out.

Re: Not able to load avro schema fully with all its contents

2015-05-18 Thread Check Peck
And this is my to_string method I forgot to provide. std::string DataSchema::to_string() const { ostringstream os; if (valid()) { os JSON data: ; m_schema.toJson(os); } return os.str(); } On Mon, May 18, 2015 at 12:54 PM, Check Peck comptechge...@gmail.com

Re: Not able to load avro schema fully with all its contents

2015-05-18 Thread Check Peck
Does anyone have any idea on this why it is behaving like this? On Mon, May 18, 2015 at 1:03 PM, Check Peck comptechge...@gmail.com wrote: And this is my to_string method I forgot to provide. std::string DataSchema::to_string() const { ostringstream os; if (valid

Avro Encoding Options?

2015-04-20 Thread Check Peck
If we want to encode the data then we have two options as of now. - A binary encoder, which encodes into binary Avro data avro::binaryEncoder() http://avro.apache.org/docs/current/api/cpp/html/namespaceavro.html#ad0158bd2fc76615b68db68d7e4f7c4f6 - A JSON encoder, which encodes into

Re: How to change a particular field value after decoding the original byte array?

2015-01-12 Thread Check Peck
, Check Peck comptechge...@gmail.com wrote: I have an Avro Schema which is like this - { type:record, name:new_user, namespace:com.hello, fields:[ { name:user_id, type:[ long