You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Ben Walsh <be...@yahoo.co.uk> on 2013/05/07 12:17:18 UTC

Avro-C: namespace lookup and inherited namespaces

Hi

It seems that the C version of Avro doesn't resolve fully-qualified type 
names, and it doesn't understand inherited namespaces.

For example this doesn't work:

{"type": "record", "namespace": "x", "name": "Y", "fields": [
   {"name": "e", "type": {"type": "record", "name": "Z", "fields": [
     {"name": "f", "type": "x.Z"}
   ]}}
]}

It can't find the type "x.Z".

(this is similar to a Ruby 
problem https://issues.apache.org/jira/browse/AVRO-635).

I have a patch to make this work. Should I submit a JIRA or is this issue 
already fixed/not a problem?

Thanks

Ben

Re: Avro-C: namespace lookup and inherited namespaces

Posted by Ben Walsh <be...@yahoo.co.uk>.
It looks like a similar approach -- the parser functions now take the 
namespace of the enclosing scope (the Ruby version calls it 
"default_namespace" and I call it "parent_namespace"). Plus there's some 
extra logic to take into account the fully-qualified name.

Thanks for pointing that out.

Ben

On Tue, 7 May 2013, Martin Kleppmann wrote:

> FWIW, I think the Ruby bug was fixed here:
> https://issues.apache.org/jira/browse/AVRO-1272 — take a look at the patch,
> perhaps you can adopt a similar approach in the C implementation (I don't
> know how similar the code is though, so it may be irrelevant).
>
> Martin
>
>
> On 7 May 2013 02:30, Bruce Mitchener <br...@gmail.com> wrote:
>
>> On May 7, 2013, at 5:17 PM, Ben Walsh <be...@yahoo.co.uk> wrote:
>>
>>>
>>> Hi
>>>
>>> It seems that the C version of Avro doesn't resolve fully-qualified type
>> names, and it doesn't understand inherited namespaces.
>>>
>>> For example this doesn't work:
>>>
>>> {"type": "record", "namespace": "x", "name": "Y", "fields": [
>>>  {"name": "e", "type": {"type": "record", "name": "Z", "fields": [
>>>    {"name": "f", "type": "x.Z"}
>>>  ]}}
>>> ]}
>>>
>>> It can't find the type "x.Z".
>>>
>>> (this is similar to a Ruby problem
>> https://issues.apache.org/jira/browse/AVRO-635).
>>>
>>> I have a patch to make this work. Should I submit a JIRA or is this
>> issue already fixed/not a problem?
>>
>> Sounds like a patch in JIRA would be ideal.
>>
>>  - Bruce
>>
>>
>

Re: Avro-C: namespace lookup and inherited namespaces

Posted by Martin Kleppmann <ma...@rapportive.com>.
FWIW, I think the Ruby bug was fixed here:
https://issues.apache.org/jira/browse/AVRO-1272 — take a look at the patch,
perhaps you can adopt a similar approach in the C implementation (I don't
know how similar the code is though, so it may be irrelevant).

Martin


On 7 May 2013 02:30, Bruce Mitchener <br...@gmail.com> wrote:

> On May 7, 2013, at 5:17 PM, Ben Walsh <be...@yahoo.co.uk> wrote:
>
> >
> > Hi
> >
> > It seems that the C version of Avro doesn't resolve fully-qualified type
> names, and it doesn't understand inherited namespaces.
> >
> > For example this doesn't work:
> >
> > {"type": "record", "namespace": "x", "name": "Y", "fields": [
> >  {"name": "e", "type": {"type": "record", "name": "Z", "fields": [
> >    {"name": "f", "type": "x.Z"}
> >  ]}}
> > ]}
> >
> > It can't find the type "x.Z".
> >
> > (this is similar to a Ruby problem
> https://issues.apache.org/jira/browse/AVRO-635).
> >
> > I have a patch to make this work. Should I submit a JIRA or is this
> issue already fixed/not a problem?
>
> Sounds like a patch in JIRA would be ideal.
>
>  - Bruce
>
>

Re: Avro-C: namespace lookup and inherited namespaces

Posted by Bruce Mitchener <br...@gmail.com>.
On May 7, 2013, at 5:17 PM, Ben Walsh <be...@yahoo.co.uk> wrote:

> 
> Hi
> 
> It seems that the C version of Avro doesn't resolve fully-qualified type names, and it doesn't understand inherited namespaces.
> 
> For example this doesn't work:
> 
> {"type": "record", "namespace": "x", "name": "Y", "fields": [
>  {"name": "e", "type": {"type": "record", "name": "Z", "fields": [
>    {"name": "f", "type": "x.Z"}
>  ]}}
> ]}
> 
> It can't find the type "x.Z".
> 
> (this is similar to a Ruby problem https://issues.apache.org/jira/browse/AVRO-635).
> 
> I have a patch to make this work. Should I submit a JIRA or is this issue already fixed/not a problem?

Sounds like a patch in JIRA would be ideal.

 - Bruce