You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Scott Carey (JIRA)" <ji...@apache.org> on 2011/08/10 22:57:27 UTC

[jira] [Issue Comment Edited] (AVRO-872) Allow interdependancies across IDL schema imports

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

Scott Carey edited comment on AVRO-872 at 8/10/11 8:56 PM:
-----------------------------------------------------------

Two things block me from using AvroIDL:

* I started maintaining and using Avro schemas before AvroIDL existed, so it is natural for developers on my project to use the JSON form, not AvroIDL.
* AvroIDL only supports protocols.  I only use schemas.

The former can be overcome, AvroIDL should be easier to use anyway.
The latter needs work, and I haven't looked at what it would take to extend AvroIDL to work with schemas.

      was (Author: scott_carey):
    Two things block me from using AvroIDL:

* I started maintaining and using Avro schemas before it existed, so it is natural for developers on my project to use the JSON form, not AvroIDL.
* AvroIDL only supports protocols.  I only use schemas.
  
> Allow interdependancies across IDL schema imports
> -------------------------------------------------
>
>                 Key: AVRO-872
>                 URL: https://issues.apache.org/jira/browse/AVRO-872
>             Project: Avro
>          Issue Type: Improvement
>            Reporter: Bill Graham
>            Assignee: Doug Cutting
>         Attachments: AVRO-872.patch, AVRO-872.patch, AVRO-872.patch, AVRO-872_4.patch
>
>
> This currently doesn't work because Player depends on Position, but it should:
> {noformat}
> $ cat position.avsc 
> {"type":"enum", "name": "Position", "namespace": "avro.examples.baseball",
>     "symbols": ["P", "C", "B1", "B2", "B3", "SS", "LF", "CF", "RF", "DH"]
> }
> $ cat player.avsc 
> {"type":"record", "name":"Player", "namespace": "avro.examples.baseball",
>   "fields": [
>    {"name": "number", "type": "int"},
>    {"name": "first_name", "type": "string"},
>    {"name": "last_name", "type": "string"},
>    {"name": "position", "type": {"type": "array", "items": "avro.examples.baseball.Position"} }
>   ]
> }
> $ cat baseball.avdl 
> @namespace("avro.examples.baseball")
> protocol Baseball {
>    import schema "position.avsc";
>    import schema "player.avsc";
> }
> $ java -jar avro-tools-1.5.1.jar idl baseball.avdl baseball.avpr
> {noformat}

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