[ 
https://issues.apache.org/jira/browse/AVRO-3532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17572558#comment-17572558
 ] 

Ryan Skraba commented on AVRO-3532:
-----------------------------------

Hello!  I think it's worth discussing and reaching consensus on the mailing 
list.

If I understand correctly, the original rules for names were to "as simple as 
possible" to maximize the chances that code could be generated for any given 
language – but *even* given that many/most modern languages support unicode, 
it's practical to avoid any issues that come with powerful, multi-byte 
encodings. [~kniemitalo] pointed out a couple of issues, but there are plenty 
of considerations to take into account [1][2][3].

The usual reason we see for requiring Unicode names is so that Avro schemas can 
accurately model other frameworks, datastores or persistence layers, or even 
the internationalized names on a UI. I think this is a great goal! The current 
workaround is to add a custom JSON property like {*}{{{"name": "age", 
"db.label}}{*}" {{*: "Âge", ...}*}}  and take that annotation into account in 
the tools that work with that framework.  Maybe a better solution would be to 
agree on a and codify a standard annotation that we can use _in addition to_ 
the simple name? 


 

[1]: [https://engineering.atspotify.com/2013/06/creative-usernames/] "Spotify 
case study with unexpected Unicode consequences"
[2]: [https://unicode.org/reports/tr15/] "Unicode Normalization Forms"
[2]: [https://unicode.org/reports/tr36/] "Unicode Security Considerations"

> Align naming rules on code
> --------------------------
>
>                 Key: AVRO-3532
>                 URL: https://issues.apache.org/jira/browse/AVRO-3532
>             Project: Apache Avro
>          Issue Type: Wish
>            Reporter: Christophe Le Saec
>            Priority: Major
>
> Description of [naming rule on 
> documentation|https://avro.apache.org/docs/current/spec.html#names] is
> {noformat}
>     - start with [A-Za-z_]
>     - subsequently contain only [A-Za-z0-9_]
> {noformat}
> But [java 
> code|https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L1578]
>  use Character.isLetter method
> {code:java}
>     char first = name.charAt(0);
>     if (!(Character.isLetter(first) || first == '_'))
>       throw new SchemaParseException("Illegal initial character: " + name);
>     for (int i = 1; i < length; i++) {
>       char c = name.charAt(i);
>       if (!(Character.isLetterOrDigit(c) || c == '_'))
>         throw new SchemaParseException("Illegal character in: " + name);
>     }
>     return name;
> {code}
> This method accept accent éùàçË ... and also chinese character (我) ...
> So, the aim of this ticket is to see if we can update the documentation, if 
> other implementations (rust, C# ...) are also compatible with ?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to