tmoschou commented on PR #2766:
URL: https://github.com/apache/avro/pull/2766#issuecomment-1963521487
Okay, I have also extended the fix to handling other code like
`GenericDatumWriter` by fixing `GenericData.getConversionByClass(datumClass,
logicalType)` which also failed when writing datums with type `Class<? extends
T>` rather than `Class<T>`. We didn't notice it before as we are using our own
custom writer. The only other usage I can see potentially being a problem is
`GenericData.getConversionByClass(class)` whose usage as far as I can tell is
only used for schema inference in Reflect/Protobuf - I that case I think it
makes sense to keep the old behaviour, although some might have knowledge that
values of a specific logical type is always of a particular subclass, although
they can always use `@AvroSchema` for Reflect data. E.g.
```java
class MyRecord {
String foo;
@AvroSchema("{\"type\":\"string\",\"logical-type\":\"json\"")
ObjectNode metadata;
}
```
where conversion is defined for `JsonNode`
(`JsonNode.class.isAssignableFrom(ObjectNode.class)`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]