You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Kalle Niemitalo (Jira)" <ji...@apache.org> on 2022/07/26 12:12:00 UTC

[jira] [Commented] (AVRO-3532) Align naming rules on code

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

Kalle Niemitalo commented on AVRO-3532:
---------------------------------------

How should non-ASCII names be compared during type lookups and schema compatibility checks: strict binary equality, or Unicode normalization?

Do you intend to allow control characters as well? In particular, allowing null characters would require changing the API of the C implementation, which uses null-terminated strings. (The C++ implementation might be less affected.)

> 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)