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

Norman Fung JP updated AVRO-1724:
---------------------------------
    Attachment: simpleTest.zip

Sample avsc files

> avrogen.exe "import" handling
> -----------------------------
>
>                 Key: AVRO-1724
>                 URL: https://issues.apache.org/jira/browse/AVRO-1724
>             Project: Avro
>          Issue Type: Bug
>            Reporter: Norman Fung JP
>         Attachments: simpleTest.zip
>
>
> I have two simple JSON Schema in SAMEfolder:
> Content in "simpleA.avsc" as follows:
> {
>  "namespace": "com.bearstearns",
>  "type": "record",
>  "name": "simpleA",
>  "imports": ["simpleB.avsc"],
>  "fields": 
>       [
>               {"name":"appName","type":"string"},
>               {"name":"userId","type":"string"},
>               
> {"name":"nestedB","type":[{"type":"array","items":"simpleB"},"null"]}
>       ]
> }
> Content in "simpleB.avsc" as follows:
> {"namespace": "com.bearstearns",
>  "type": "record",
>  "name": "simpleB",
>  "fields": 
>       [
>               {"name":"ID","type":"string"},
>               {"name":"SimpleName","type":"string"}
>       ]
> }
> Avrogen can be downloaded from Download from 
> http://apache.communilink.net/avro/avro-1.7.7/avro-csharp-1.7.7.tar.gz
> From Command Prompt,
>     avrogen -s simpleA.avsc outputDir
> The error message is:
>     "Exception occurred. Undefined name: simpleB"
> I also try using avrogen -p switch in combination with protocol file, no joy.
> For this method, I first define the protocol file "bearstearns.avdl"
> @namespace("com.bearstearns")
> protocol BearStearns {
>       import schema "simpleA.avsc";
>       import schema "simpleB.avsc";
> }
> Then from command prompt:
> avrogen -p bearstearns.avdl outputDir
> This time, the error message is,
> Exception occurred. Invalid JSON format: @namespace("com.bearstearns")
> protocol BearStearns {
>         import schema "simpleA.avsc";
>         import schema "simpleB.avsc";
> }
> Actually is Avro support for dotnet ready yet? Avro official doc for C# is 
> completely empty: http://avro.apache.org/docs/current/api/csharp/index.html
> Their guys even created a ticket for this in DEC 2013. 
> https://issues.apache.org/jira/browse/AVRO-1420
> As of August 2015, Avro doc for C# remains empty. And not much foot print in 
> Internet (C# and Avro I meant). 
> References:
> •     Official: https://avro.apache.org/docs/1.7.7/index.html 
> •     Download utility avrogen.exe: 
> http://apache.communilink.net/avro/avro-1.7.7/ 
> •     
> http://www.tutorialspoint.com/avro/serialization_by_generating_class.htm 
> •     
> http://www.michael-noll.com/blog/2013/03/17/reading-and-writing-avro-files-from-the-command-line/
>  



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

Reply via email to