[ 
https://issues.apache.org/jira/browse/AVRO-1663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Kleppmann updated AVRO-1663:
-----------------------------------
    Attachment: AVRO-1663-4.patch

Thanks for reviewing, [~dcreager]! I've attached an updated (v4) patch that 
uses strrchr.

The v4 patch also leaves the function signature of {{avro_schema_fixed}} and 
{{avro_schema_enum}} unchanged, and instead adds two new functions  
{{avro_schema_fixed_ns}} and {{avro_schema_enum_ns}} that take an additional 
namespace parameter. This avoids a compatibility-breaking API change. It has 
the downside of making the API slightly inconsistent ({{avro_schema_record}} 
takes a namespace argument, but doesn't have a {{_ns}} suffix) but on balance 
this is probably the best compromise. What do you think?

Finally, could you confirm what changes to {{lang/c/version.sh}} are required? 
If I read the instructions correctly, it should be

{code}
libavro_micro_version++
libavro_interface_age=0
libavro_binary_age++
{code}

> C Library does not handle enum's namespace
> ------------------------------------------
>
>                 Key: AVRO-1663
>                 URL: https://issues.apache.org/jira/browse/AVRO-1663
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.7.7
>            Reporter: Thomas Sanchez
>            Assignee: Martin Kleppmann
>         Attachments: AVRO-1663-2.patch, AVRO-1663-3.patch, AVRO-1663-4.patch, 
> AVRO-1663.patch
>
>
> {code}{
>   "type": "record",
>   "name": "EventName",
>   "namespace": "com.company.avro.schemas",
>   "fields": [
>     {"name": "eventname_model",
>      "type": {
>        "type": "enum",
>        "namespace": "com.company.models",
>        "name": "EventName",
>        "symbols": ["XXXX"]
>      }
>     }
>  ]
> }
> {code}
> Such a schema is perfectly valid but the C library does no handle it because 
> it does not parse the namespace field.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to