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

Raymie Stata commented on AVRO-22:
----------------------------------

It's a pain to have to special-case code that handles record-names to always be 
checking for null (and also, as noted previously, the resolution rules are 
non-obvious).  What if the "request" schema of a Message always had the name 
"args", and the "response" schema always had the name "results".  Then we get 
rid of null names altogether.

(BTW, Protocol.createMessage should probably throw IllegalArgumentException 
when passed arguments of the wrong type (e.g., a non-record schema for 
"request").)

> 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
>            Assignee: Doug Cutting
>             Fix For: 1.0
>
>
> 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