avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Combining schemas
Date Tue, 09 Aug 2011 18:59:56 GMT
On 08/09/2011 11:42 AM, Scott Carey wrote:
> On 8/9/11 11:15 AM, "Bill Graham" <billgraham@gmail.com
> <mailto:billgraham@gmail.com>> wrote:
[ ... ]
>     Also FYI, it seems enum values can't start with numbers (i.e. '1B').
>     Is this a know issue or a feature? I haven't seen it documented
>     anywhere. You get an error like this if the value starts with a number:
> 
>     org.apache.avro.SchemaParseException: Illegal initial character
> 
> Enums are a named type.  The enum names must start with [A-Za-z_]  and
> subsequently contain only [A-Za-z0-9_].
> http://avro.apache.org/docs/1.5.1/spec.html#Names
> 
> However, the spec does not say that the values must have such
> restrictions.  This may be a bug, can you file a JIRA ticket?

Enum values are identifiers in many programming languages (e.g., Java,
C, C++, & C#) and identifiers in these languages cannot begin with a
digit.  To simplify integration with these languages Avro should use the
same convention, but this is not stated clearly in the spec.  We should
probably clarify this, that enum symbols, record field names, and
protocol message names have the same restrictions as type names.  That's
what's currently implemented in Java.

Doug

Mime
View raw message