Richard Wilkinson created AVRO-2873:
---------------------------------------
Summary: Reflect Reader does not handle cases where record name is
different
Key: AVRO-2873
URL: https://issues.apache.org/jira/browse/AVRO-2873
Project: Apache Avro
Issue Type: Bug
Components: csharp
Affects Versions: 1.9.2
Reporter: Richard Wilkinson
It is possible that two record schema with different names are compatible
(using an alias), but the ReflectDefaultReader only ever registers the
readerSchema in the class cache.
-
[https://github.com/apache/avro/blob/master/lang/csharp/src/apache/main/Reflect/ReflectDefaultReader.cs#L73]
However then during reading it queries the class cache for the writer schema:
[https://github.com/apache/avro/blob/master/lang/csharp/src/apache/main/Reflect/ReflectDefaultReader.cs#L421]
Since the class cache is keyed on FullName, this lookup fails.
This could be fixed by conditionally also registering the writerSchema if
FullName is different, but can also be worked around by passing in my own
ClassCache with the writerSchema already registered.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)