avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "suyash kharade (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1753) Support for import in avpr file from avsc schema file
Date Thu, 29 Oct 2015 13:50:27 GMT

     [ https://issues.apache.org/jira/browse/AVRO-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

suyash kharade updated AVRO-1753:
---------------------------------
    Description: 
I have two schema file

First is position.avsc

{
"type":"enum", "name": "Position", "namespace": "avro.examples.baseball",
    "symbols": ["P", "C", "B1", "B2", "B3", "SS", "LF", "CF", "RF", "DH"]
}

Second is 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"}
}
  ]
}

I can import these schemas in avdl

@namespace("avro.examples.baseball")
protocol Baseball {
   import schema "position.avsc";
   import schema "player.avsc";
}

But I want define above protocol in json and import those schemas in protocol file.
This will be helpful for reusability of schema



> Support for import in avpr file from avsc schema file
> -----------------------------------------------------
>
>                 Key: AVRO-1753
>                 URL: https://issues.apache.org/jira/browse/AVRO-1753
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.7
>            Reporter: suyash kharade
>
> I have two schema file
> First is position.avsc
> {
> "type":"enum", "name": "Position", "namespace": "avro.examples.baseball",
>     "symbols": ["P", "C", "B1", "B2", "B3", "SS", "LF", "CF", "RF", "DH"]
> }
> Second is 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"}
}
>   ]
> }
> I can import these schemas in avdl
> @namespace("avro.examples.baseball")
> protocol Baseball {
>    import schema "position.avsc";
>    import schema "player.avsc";
> }
> But I want define above protocol in json and import those schemas in protocol file.
> This will be helpful for reusability of schema



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message