In the names section of the specification (
https://avro.apache.org/docs/current/spec.html#names) it currently states
the following:

References to previously defined names are as in the latter two cases
above: if they contain a dot they are a fullname, if they do not contain a
dot, the namespace is the namespace of the enclosing definition.

However, it seems currently the Java specification does not consider the
enclosing namespace. For example, see the following ticket:
https://issues.apache.org/jira/browse/AVRO-3118.

The subrecord "row" is being specified as a null namespace so the fullname
is just "row". However, the "field_b" in the original schema has type "row"
and according to the spec it doesn't have a dot in the name and so it
should use the enclosing namespace of "my_ns" and should have the
fullname of "my_ns.row". These two fullnames do not match and so the schema
should fail to parse since "my_ns.row" is not defined.

Changing the Java code to conform to the specification would be a breaking
change. Alternatively, the specification could be changed to say the
following:

References to previously defined names are always treated as fullnames. If
the reference does not have a dot then it is considered to have a null
namespace.

What do others think should be done?

-Scott

Reply via email to