Closed piotaixr closed 1 year ago
I guess there’s nothing to do then?
There is. I just opened https://issues.apache.org/jira/browse/AVRO-3790
PR opened in the Avro repo: https://github.com/apache/avro/pull/2409
Stale issue message
Avro 1.11.3 has been released, I can now create a PR to fix this issue!
The avro specification states in https://avro.apache.org/docs/1.10.2/spec.html#names:
This means that, if we have the following schema file:
foo/bar.avsc
... then, the
another_schema
schema MUST be in thefoo
namespace asA name only is specified, i.e., a name that contains no dots. In this case the namespace is taken from the most tightly enclosing schema or protocol
Currently, the
AvroTurf::SchemaStore
will try to loadanother_schema.avsc
in the null namespace (at the root of the provided path) instead of in thefoo
folder.I did not find a workaround for this as:
another_schema.avsc
file is at the root, Avro do not find the schema in the provided cache, which causes a double load, and Avro raises a "already in use" erroranother_schema.avsc
file is in thefoo
folder like it should be according to spec, then theSchemaStore
do not find it as the file name to load is extracted from the exception message, and this message do not contains the fullname, but only the name of the schema that is attempted to be loaded.The only solution is to explicitely provide the namespace for every nested schema reference that we expect the schema store to load, even if the specification allows us not to.