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

Doug Cutting commented on AVRO-22:
----------------------------------

> This doesn't seem to require that both are null to match: if the name of 
> branch is null and the name actual is not, then we get a match, which I think 
> is a bug.

I did that intentionally, thinking that, if one doesn't specify a name in a 
record, one doesn't care to match names, and it should match anything.  But 
that's not intuitive to all!

> Anonymous record names are a pain, can we get rid of them?

We use unnamed records  internally to implement message parameters.  These are 
serialized and deserialized just like named records, so it's nice to be able to 
share that code.

We might:
 # ban unnamed user-schemas, but continue to use them to implement parameters; 
or
 # define an unnamed superclass of RecordSchema that's used for parameters.

The latter would probably be substantially more complicated than the former, 
and force us to expand the public interface, so my preference is for the 
former.  Other ideas?

> Kill anonymous records or fix GenericDatumReader
> ------------------------------------------------
>
>                 Key: AVRO-22
>                 URL: https://issues.apache.org/jira/browse/AVRO-22
>             Project: Avro
>          Issue Type: Bug
>          Components: spec
>            Reporter: Raymie Stata
>
> Anonymous record names are a pain, can we get rid of them?
> If not, I think I noticed a bug in GenericDatumReader.resolveExpected:
> {noformat}
>      if (branch.getType() == Type.RECORD) {
>        String name = branch.getName();
>        if (name == null || name.equals(actual.getName()))
>          return branch;
>      } else
>        return branch;
> {noformat}
> This doesn't seem to require that _both_ are null to match: if the name of 
> {{branch}} is null and the name {{actual}} is not, then we get a match, which 
> I think is a bug.
> But again, let's just get rid of null names.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to