Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
1.9.0
-
None
-
None
Description
After mostly worked in Java with avro, schemas have been used in an hierachial way. I.e. Schema A imports Schema B and Schema C, Schema B imports schema C.
This works in a confluent setting. But when loading the schema, the application crashes due to reusing record types.
The following relaxes this relation.
avro.schema.py
diff --git a/lang/py3/avro/schema.py b/lang/py3/avro/schema.py index 7ce29731..63af3581 100644 --- a/lang/py3/avro/schema.py +++ b/lang/py3/avro/schema.py @@ -397,9 +397,6 @@ class Names(object): if schema.fullname in VALID_TYPES: raise SchemaParseException( '%s is a reserved type name.' % schema.fullname) - if schema.fullname in self.names: - raise SchemaParseException( - 'Avro name %r already exists.' % schema.fullname) logger.log(DEBUG_VERBOSE, 'Register new name for %r', schema.fullname) self._names[schema.fullname] = schema
Example schema:
{ "doc": "", "fields": [ { "default": null, "doc": "Optional. The context used for tracing of flow.", "name": "b", "type": [ "null", { "doc": "", "fields": [ { "doc": "", "name": "c", "type": { "doc": "", "fields": [ { "doc": "", "name": "value", "type": "string" } ], "name": "C", "type": "record" } } ], "name": "B", "type": "record" } ] }, { "doc": "", "name": "c", "type": { "doc": "", "fields": [ { "doc": "", "name": "value", "type": "string" } ], "name": "C", "type": "record" } } ], "name": "A", "namespace": "namespace", "type": "record" }
Attachments
Issue Links
- links to