Hi,

I read the exchange on this topic on avro-user mailing list archives: September 
2012 
(http://mail-archives.apache.org/mod_mbox/avro-user/201209.mbox/%3c445e44a6-345f-42fc-b340-48af3804a...@braindump.ms%3E)

I am sorry if that suppose to be obvious, but I still don't understand how to 
use the org.apache.avro.data.Json, and Json.Writer classes.
 
Particularly, how to map JSON doc. fields to AVRO schema fields.

Suppose I have a simple JSON doc:
{
"id" : "abc123",
"width" : 1.3
"details":
{
"id" : "XXX#11"
"len" : 20
}

}

Now, suppose I want AVRO schema something like:

{"namespace" : "exam",
  "type": "record",
 "name": "avro-meme",
 "fields" : [ {"name" : "id", "type ": "string"},
                   {"name" : "width", "type": "double"},
   {"name" : "details",
                        "type" : {
"type" : "record",
 "name" : "abra",
                                 "fields" : [  
{"name" : "id", "type" : "string"},
                                         {"name" : "len", "type" : "int" }
  ]
  } 
                    }
       ]
}


So how I specify json to avro mapping in org.apache.avro.data.Json , what are 
the rules of the game?
Or, if it is not how you suppose to use org.apache.avro.data.Json, then how?

Thank you
 Alexey

Reply via email to