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

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

> What if the "request" schema of a Message always had the name "args", and the 
> "response" schema always had the name "results".

RPC parameters are not the problem that's affecting Hong.  He wishes to be able 
to construct a union containing different versions of a record with the same 
name (AVRO-23), but Avro will not parse a schema that contains multiple records 
of the same name.  As a work around, he's using anonymous records.

An alternative might be to somehow permit multiple records of the same name.  
For example, the scope of a re-definition might be limited to references within 
itself.  Another alternative might be to rename records, so that Foo becomes 
Foo1, Foo2, etc.  However such approaches should be considered in AVRO-23, not 
here.

> 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