You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by ellisdp <da...@diegesis.co.uk> on 2013/07/23 11:24:09 UTC

Version Naming Convention / Namespaces

We had wanted to use a version number naming convention to indicate
successive versions of user data types, for example if we define an Avro
"Employee" record we intended to name this:

Employee.V1_0
Employee.V1_1

to indicate successive changes to the schema.

However we have found that some of the Avro tooling (for example, code
generation, and naming of embedded schema types) interprets the "." to be a
namespace separator, and generates a namespace of "Employee" and a record
name of "V1_0", which obviously is not what we intended.

Have others encountered this issue - is there a way around it? Or is there
an alternative common convention for version naming in Avro?

Thanks.




--
View this message in context: http://apache-avro.679487.n3.nabble.com/Version-Naming-Convention-Namespaces-tp4027858.html
Sent from the Avro - Users mailing list archive at Nabble.com.

Re: Version Naming Convention / Namespaces

Posted by Martin Kleppmann <ma...@rapportive.com>.
The "." is a namespace separator by design:
http://avro.apache.org/docs/current/spec.html#Names

The best way of handling versioning in Avro is not to change the name of
your records at all, and just rely on schema evolution (
http://avro.apache.org/docs/current/spec.html#Schema+Resolution). That
allows you to add or remove fields, and change field types, within certain
limitations to ensure compatibility. In fact, you make life harder for
yourself if you change names, because then you have to maintain aliases to
the old names.

Martin


On 23 July 2013 10:24, ellisdp <da...@diegesis.co.uk> wrote:

> We had wanted to use a version number naming convention to indicate
> successive versions of user data types, for example if we define an Avro
> "Employee" record we intended to name this:
>
> Employee.V1_0
> Employee.V1_1
>
> to indicate successive changes to the schema.
>
> However we have found that some of the Avro tooling (for example, code
> generation, and naming of embedded schema types) interprets the "." to be a
> namespace separator, and generates a namespace of "Employee" and a record
> name of "V1_0", which obviously is not what we intended.
>
> Have others encountered this issue - is there a way around it? Or is there
> an alternative common convention for version naming in Avro?
>
> Thanks.
>
>
>
>
> --
> View this message in context:
> http://apache-avro.679487.n3.nabble.com/Version-Naming-Convention-Namespaces-tp4027858.html
> Sent from the Avro - Users mailing list archive at Nabble.com.
>