[ 
https://issues.apache.org/jira/browse/AVRO-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028299#comment-13028299
 ] 

Doug Cutting commented on AVRO-814:
-----------------------------------

In the case of a union this might not do the right thing.  Imagine we have a 
union of Foo and Bar.  If either the majority of the instances are of Foo, or 
if there are runs of Foo then runs of Bar, we'd like to be able to re-use 
instances.  But when a Bar is read, and we pass a Foo instance down for reuse, 
we need to somehow decide whether it can actually be reused.  With specific we 
might test whether the instance passed is a subclass of Bar, but we'd need to 
test at least that.  With the reflect representation even that check may not be 
correct, as you can have a union containing both a superclass and its subclass.

> SpecificDatumReader.newRecord always looks up the classname
> -----------------------------------------------------------
>
>                 Key: AVRO-814
>                 URL: https://issues.apache.org/jira/browse/AVRO-814
>             Project: Avro
>          Issue Type: Bug
>            Reporter: Stu Hood
>
> Even when given an instance of the record class, SpecificDatumReader looks up 
> the Class in the SpecificData Class cache. This breaks decoding into 
> subclasses of a generated record class without programmatically modifying the 
> schema of the subclass, and is probably unnecessary.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to