You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Steve Roehrs <St...@rlmgroup.com.au> on 2013/04/19 07:01:17 UTC

AVRO-1270 - implementation?

Doug - in the avro-users group you posted this :

 

 

>>Chris Laws:

>> I get:
>> 
>> Reading evolved data with schema resolution, showing new field "c"...
>> Error: Reader field c doesn't appear in writer
>> 
>> I was under the impression that I should have received the default
value
>> of 42 for field 'c' for each item in the data file.
>
>So this is actually because the C API doesn't support default values
>yet.  :-/  The schema parsing code just ignores the "default" clause
>completely, which is why you're seeing that particular error message.
>
>That said, we do have all of the pieces in place to handle default
>values now; they've just never been hooked together.  Could you open a
>JIRA ticket for this?  I think it's something that we could bang
>together pretty quickly.

>cheers
>-doug

 

 

I work with Chris Laws, and for our application we need to fix
AVRO-1270, to implement default values in the C API. I've looked at the
sources and understand most of it, but I could do with a few tips.  What
exactly are all the 'pieces' you're referring to handle default values?
I can see most of the TODO comments, but I'm a little lost on exactly
how to proceed.

 

I've looked at the Java API, and I noticed that they store the default
values as a JsonNode inside the Field.  At resolution time, the
GenericDatumReader converts it to Avro format (and caches it).  I don't
think I can do the same with the C bindings - is there a function to
convert a json_t  directly into the equivalent Avro type?

 

Any advice (or code) welcome :-)

 

Regards,

 

Steve Roehrs


Default value support in C (AVRO-1270)

Posted by Nir Pachter <ni...@huawei.com>.
Hi Guys,

I know that this one is opened for a long time now.
A fix was already applied to the C++ branch with version 1.7.7.
Any updates with regards to the C branch?

Re,
Nir



--
View this message in context: http://apache-avro.679487.n3.nabble.com/AVRO-1270-implementation-tp4026927p4030869.html
Sent from the Avro - Developers mailing list archive at Nabble.com.